Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Smith, Barry F.
Thanks, I now understand the situation. I have a tentative solution for you that does not require complex new APIs. I have added one function to the master branch MatSNESMFGetSNES() and attach a modified example that utilizes this to avoid the extra function evaluations. Please let

Re: [petsc-users] How to generate manul.pdf from source files

2018-01-26 Thread Satish Balay
Its: make alldoc LOC=$PETSC_DIR Satish On Sat, 27 Jan 2018, Smith, Barry F. wrote: > > You need to run > > make alldocs > > in the root PETSc directory first. This builds many things used by the users > manual (also builds the users manual). After you have run the make alldocs > once

Re: [petsc-users] How to generate manul.pdf from source files

2018-01-26 Thread Smith, Barry F.
You need to run make alldocs in the root PETSc directory first. This builds many things used by the users manual (also builds the users manual). After you have run the make alldocs once you can rebuild just the users manual multiple times directly in the users manual directory. > On Jan

Re: [petsc-users] How to generate manul.pdf from source files

2018-01-26 Thread Kong, Fande
I guess we install sowing automatically when we are on petsc/master > cat configure.log | grep "sowing" *Bfort not found. Installing sowing for FortranStubsTEST checkDependencies from

Re: [petsc-users] How to generate manul.pdf from source files

2018-01-26 Thread Matthew Knepley
On Sat, Jan 27, 2018 at 10:53 AM, Kong, Fande wrote: > Hi, > > I want to generate manul.pdf from source files on my own desktop. > > In directory: ./src/docs/tex/manual > > make ALL LOC=/Users/kongf/projects/petsc > > * make: *** No rule to make target >

Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Alexander Lindsay
We are doing something non-standard. We set different functions for snes and mffd. When a function is called through snes, we know we are doing a non-linear residual evaluation and we allow an update of our mechanical contact nodes. When a function is called through mffd, we know we are within

[petsc-users] How to generate manul.pdf from source files

2018-01-26 Thread Kong, Fande
Hi, I want to generate manul.pdf from source files on my own desktop. In directory: ./src/docs/tex/manual make ALL LOC=/Users/kongf/projects/petsc * make: *** No rule to make target `/Users/kongf/projects/petsc/docs/manualpages/htmlmap', needed by `listing_kspex1tmp.tex'. Stop.* What else

Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Kong, Fande
Hi Barry, I made minor changes on src/snes/examples/tutorials/ex2.c to demonstrate this issue. Please see the attachment. ./ex2 -snes_monitor -ksp_monitor -snes_mf_operator 1 *atol=1e-50, rtol=1e-08, stol=1e-08, maxit=50, maxf=1 FormFunction is called 0 SNES

Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Smith, Barry F.
So you are doing something non-standard? Are you not just using -snes_mf or -snes_mf_operator? Can you send me a sample code that has the extra function evaluations? Because if you run through regular usage with the debugger you will see there is no extra evaluation. Barry > On Jan

Re: [petsc-users] A question on Schur complement

2018-01-26 Thread Jed Brown
saturday luis writes: > Thanks, Jed. > > It seems that MatCreateLRC requires two dense matrices for U and V > according to the page > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateLRC.html > > Not sure if it is applicable to sparse matrices.

Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Kong, Fande
On Fri, Jan 26, 2018 at 3:10 PM, Smith, Barry F. wrote: > > > > On Jan 26, 2018, at 2:15 PM, Kong, Fande wrote: > > > > > > > > On Mon, Jan 8, 2018 at 2:15 PM, Smith, Barry F. > wrote: > > > > > > > On Jan 8, 2018, at 2:59 PM,

Re: [petsc-users] A question on Schur complement

2018-01-26 Thread saturday luis
Thanks, Jed. It seems that MatCreateLRC requires two dense matrices for U and V according to the page http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateLRC.html Not sure if it is applicable to sparse matrices. 2018-01-26 12:09 GMT-08:00 Jed Brown : >

Re: [petsc-users] Context behind SNESComputeFunction call

2018-01-26 Thread Smith, Barry F.
> On Jan 26, 2018, at 2:15 PM, Kong, Fande wrote: > > > > On Mon, Jan 8, 2018 at 2:15 PM, Smith, Barry F. wrote: > > > > On Jan 8, 2018, at 2:59 PM, Alexander Lindsay > > wrote: > > > > Is there any elegant way to tell

Re: [petsc-users] A question on Schur complement

2018-01-26 Thread Jed Brown
saturday luis writes: > Hi PETSc team: > > I want to consult for a good way of doing an approximated Schur complement > matrix. So I just want to handle a matrix in the format C + B^t B, or > sometimes B^t B. > > An easy way is to run with the MatCreateSchurComplement to

[petsc-users] Fwd: [petsc-maint] A question on Schur complement

2018-01-26 Thread saturday luis
Thanks, Barry! Do you have any suggestions on solving the B^tB matrix? I noticed the solver option LSQR but haven't tried it yet. Luis 2018-01-26 11:25 GMT-08:00 Smith, Barry F. : > > > > On Jan 26, 2018, at 1:18 PM, saturday luis > wrote: > > >

Re: [petsc-users] [petsc-maint] A question on Schur complement

2018-01-26 Thread Smith, Barry F.
> On Jan 26, 2018, at 1:18 PM, saturday luis wrote: > > Hi PETSc team: > > I want to consult for a good way of doing an approximated Schur complement > matrix. So I just want to handle a matrix in the format C + B^t B, or > sometimes B^t B. > > An easy way is to

[petsc-users] A question on Schur complement

2018-01-26 Thread saturday luis
Hi PETSc team: I want to consult for a good way of doing an approximated Schur complement matrix. So I just want to handle a matrix in the format C + B^t B, or sometimes B^t B. An easy way is to run with the MatCreateSchurComplement to create C + B^t inv A B, wherein A is an identity matrix. The

Re: [petsc-users] Changing the operator for PCMG while leaving interpolation matrices unchanged

2018-01-26 Thread Smith, Barry F.
Great > On Jan 26, 2018, at 9:48 AM, Ben Yee wrote: > > Hi Barry, > > This seems to work for me. I defined the following function in our code > repository, and I call it every time I use KSPSetOperators to update the > operator for my KSP object with PCMG: > >

Re: [petsc-users] Changing the operator for PCMG while leaving interpolation matrices unchanged

2018-01-26 Thread Ben Yee
Hi Barry, This seems to work for me. I defined the following function in our code repository, and I call it every time I use KSPSetOperators to update the operator for my KSP object with PCMG: PetscErrorCode PCMGSoftReset(PC pc) { PC_MG *mg= (PC_MG*)pc->data; PC_MG_Levels

Re: [petsc-users] Is there a partition section in a distributed DM object?

2018-01-26 Thread Matthew Knepley
On Wed, Jan 24, 2018 at 3:17 PM, Jordan Wagner wrote: > Hi, > > At some point, I would like to export my distributed DM along with an > associated scalar field corresponding to the process rank for which each > point is owned. I know that what I need is the partition section,

Re: [petsc-users] Novice: How to implement the petsc Gmres libraries in my CFD code

2018-01-26 Thread Matthew Knepley
On Sat, Jan 27, 2018 at 1:55 AM, Smith, Barry F. wrote: > > > > On Jan 26, 2018, at 3:39 AM, Stephen Wornom > wrote: > > > > I am disparate to implement the petsc library gmres in an CFD code and > need a little help to get going. > > > > 23 years

Re: [petsc-users] Novice: How to implement the petsc Gmres libraries in my CFD code

2018-01-26 Thread Matthew Knepley
On Fri, Jan 26, 2018 at 8:39 PM, Stephen Wornom wrote: > I am disparate to implement the petsc library gmres in an CFD code and > need a little help to get going. > > 23 years ago, gmres was implemented/written in the code by Y. Saad, > modified by A. Malevsky, version

[petsc-users] Novice: How to implement the petsc Gmres libraries in my CFD code

2018-01-26 Thread Stephen Wornom
I am disparate to implement the petsc library gmres in an CFD code and need a little help to get going. 23 years ago, gmres was implemented/written in the code by Y. Saad, modified by A. Malevsky, version February 1, 1995. petsc, most likely started with the same version, added new solvers,