Re: [petsc-users] Petsc with Windows

2016-11-29 Thread Jed Brown
Elaine Tang  writes:

> I am developing some software on windows that would like to utilize petsc
> library. Currently I have petsc library configured on cygwin on my windows
> machine.

This is probably a better choice than Cygwin going forward.

https://msdn.microsoft.com/en-us/commandline/wsl/about

I don't know to what extent PETSc users have experimented with this
feature, but it should make it easier to build and distribute PETSc.

> Is there any binary of petsc for windows so that the software that I
> develop will be more portable and can be run on other windows machine as
> well?

Are you developing an application or a library?


signature.asc
Description: PGP signature


[petsc-users] superlu_dist issue

2016-11-29 Thread Kong, Fande
Hi All,

I think we have been discussing this topic for a while in other threads.
But I still did not get yet. PETSc uses 'SamePattern' as the default
FactPattern. Some test cases in MOOSE fail with this default option, but I
can make these tests pass if I set the FactPattern as
'SamePattern_SameRowPerm' by using -mat_superlu_dist_fact
SamePattern_SameRowPerm.

Does this make sense mathematically? I can not understand.  'SamePattern'
should  be more general than 'SamePattern_SameRowPerm'. In other words, if
something works with 'SamePattern_SameRowPerm', it definitely should work
with 'SamePattern' too.

Thanks as always.

Fande,


Re: [petsc-users] How do I Ensure that Two DMDA Objects Are Coupled Correctly?

2016-11-29 Thread Dave May
For collocated variables, I recommend you use the function
DMDAGetReducedDMDA()

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDAGetReducedDMDA.html

That's the simplest option.


In general, if the 2 dmdas have the same number of points in each
direction, and you let petsc determine the partitions when you called
DMDACreate3d(), they will have the same layout in parallel.

You can confirm they overlap using the returned values from
DMDAGetCorners() and DMDAGetGhostCorners().

Alternatively you can specify the layout yourself when you create the DMDAs
using the lx[] ly[] lz[] arrays. See

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMDACreate3d.html


Thanks
Dave

On Tue, 29 Nov 2016 at 07:58, Clark C Pederson  wrote:

> Dear all,
>
> I'm writing a simple solver for the time-dependent incompressible
> Navier-Stokes equations, using a structured grid and a fractional step
> approach.  Specifically, I'm following the approach of Kim and Moin, from
> their 1985 paper. To those who are unfamiliar with fractional step methods,
> you separate out the equation solving process into multiple steps.  In the
> first step, you advance your velocity fields in time to obtain an
> "uncorrected" velocity.  In the second step, you compute a pressure-like
> term using the uncorrected velocities.  In the third step, you compute the
> correct velocities using the pressure-like term.
>
> This lead me to my question: There's two types of data I need to work with
> in different ways.  The first is the velocity field (u,v,w), which needs to
> be updated using time-stepping routines.  The second is the pressure-like
> term, which is solved for in a Poisson equation.  What is the best way to
> couple these two fields, using distributed arrays?
>
> The suggestion here: (
> http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019022.html)
> is to use two DMDAs, one for the velocities with 3 DoF and one for the
> pressures with 1 DoF.  This seems like the simplest way to work with the
> problem, aside from one problem: when the two arrays need to interface, how
> do I ensure that the local processes align?  In other words, how do I make
> sure that my local array p[k][j][i] can pull the correct information from
> the local vel[k][j][i].u etc. array locations? The points would be
> identical or neighboring points on the structured grid, but they would be
> part of two different DMDA objects.  How do I make sure that each processor
> has the data it needs?
>
> I've looked in the manual, examples, and the mailing list, but I couldn't
> find anything that answered this question.  The answer may be very simple,
> so any help is appreciated.
>
> Thanks,
> Clark Pederson
>


Re: [petsc-users] pcfieldsplitting not working for VI

2016-11-29 Thread Lawrence Mitchell
I suspect this is not a petsc issue per se. Shall we migrate this to the 
firedrake list?

Lawrence 

> On 29 Nov 2016, at 07:40, Justin Chang  wrote:
> 
> FWIW I ended up doing this:
> 
> rs_solver.setDM(W._dm())
> 
> and was left with this error:
> 
> Traceback (most recent call last):
>   File "sphere.py", line 180, in 
> virs()
>   File "sphere.py", line 163, in virs
> rs_solver.solve(None,sol_vec)
>   File "PETSc/SNES.pyx", line 537, in petsc4py.PETSc.SNES.solve 
> (src/petsc4py.PETSc.c:170012)
> petsc4py.PETSc.Error: error code 75
> [0] SNESSolve() line 4060 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/snes/interface/snes.c
> [0] SNESSolve_VINEWTONRSLS() line 424 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/snes/impls/vi/rs/virs.c
> [0] MatGetSubMatrix() line 7929 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/mat/interface/matrix.c
> [0] MatGetSubMatrix_Nest() line 451 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
> [0] MatNestFindSubMat() line 424 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
> [0] MatNestFindIS() line 363 in 
> /private/var/folders/92/1kh0g4kn2z50fnwsmf8s269wgn/T/pip-gYEj0p-build/src/mat/impls/nest/matnest.c
> [0] Arguments are incompatible
> [0] Could not find index set
> 
> I must be doing something wrong here.
> 
> Justin
> 
>> On Tue, Nov 29, 2016 at 1:24 AM, Justin Chang  wrote:
>> Lawrence,
>> 
>> I added the following line:
>> 
>> rs_solver.setDM(a._dm)
>> 
>> And it gives this error:
>> 
>> Traceback (most recent call last):
>>   File "sphere.py", line 128, in 
>> rs_solver.setDM(a._dm)
>> AttributeError: 'Form' object has no attribute '_dm'
>> 
>> Thanks,
>> Justin
>> 
>>> On Tue, Nov 29, 2016 at 1:12 AM, Lawrence Mitchell 
>>>  wrote:
>>> 
>>> 
>>> > On 29 Nov 2016, at 02:02, Justin Chang  wrote:
>>> >
>>> > Why is this happening? It seems to me VINEWTONRSLS is not understanding 
>>> > that I have a two-field formulation.
>>> 
>>> For the built in solvers, we set up a dmshell on the snes that knows how to 
>>> do field splitting.  Because you set your snes up by hand, it isn't 
>>> available. You'll need to call snes.setDM. The mixed finctionspace provides 
>>> the correct dm via a ._dm property I think.
>>> 
>>> Lawrence
>> 
>