[petsc-users] Including constrained dofs in a matrix/vector created with DMCreateXXXX()

2019-02-18 Thread Jordan Wagner via petsc-users
Hi, Over the past few months, I have implemented dmplex/section in my preexisting finite element code. We already had our own implementations for things like the finite element space, boundary conditions, projections, etc, so I am mostly using dmplex/section at its lowest level; no DT/DS

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
Oh I see, thanks for confirming it works with an 8-byte file. I didn't generate it from a code but just put a random number in a blank file. I thought it would automatically be the right size but that isn't the case. Get Outlook for iOS

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Smith, Barry F. via petsc-users
I don't know how you got your _test file but it is the wrong size $ ls -l _test -rw-r--r--@ 1 barrysmith staff 6 Feb 18 21:25 _test ~/Src/petsc/test-dir (maint=) arch-basic it only has 6 bytes but to hold a PETSC_SCALAR (when PetscScalar is real) it should have 8 bytes. For example the

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
I used FILE_MODE_READ. Please see attached file (the function is part of another file therefore all the other include statements; I've extracted it here). The test file only contains one number. My directory is hard-coded into the main function. Thanks a lot! Yuyun -Original Message-

Re: [petsc-users] PetscBinaryRead fails

2019-02-18 Thread Smith, Barry F. via petsc-users
Send program and data file if you cannot get it to work. > On Feb 18, 2019, at 8:08 PM, Yuyun Yang via petsc-users > wrote: > > Hello, > > I am writing a very simple function just to read in a single value from an > input file (which also just contains one single scalar value). Using

[petsc-users] PetscBinaryRead fails

2019-02-18 Thread Yuyun Yang via petsc-users
Hello, I am writing a very simple function just to read in a single value from an input file (which also just contains one single scalar value). Using PetscBinaryRead(fd, , 1, PETSC_SCALAR) gives me the following error. Could you help me figure out why? [0]PETSC ERROR: -

Re: [petsc-users] saving results

2019-02-18 Thread Smith, Barry F. via petsc-users
I'm guessing you mange your own time stepping (and nonlinear solver if there is one)? You can save the solution with a call to VecView() and then reload the solution with a VecLoad() but you need to manage any other restart data that you may need, like the value of the current time

Re: [petsc-users] saving results

2019-02-18 Thread Jed Brown via petsc-users
What kind of problems are you solving? Running for a Krylov method for tens of thousands of iterations is very rarely recommended. Regarding storage, it's significantly more expensive to store the Krylov basis (even when it's a recurrence) than the current approximation. Some methods require

Re: [petsc-users] saving results

2019-02-18 Thread Jed Brown via petsc-users
What kind of solver are you using and how often do you want to write? Sal Am via petsc-users writes: > Is there a function/command line option to save the solution as it is > solving (and read in the file from where it crashed and keep iterating from > there perhaps)? > Had a seg fault and all