<div dir="ltr">What version of petsc are you using?<div>DMlibMesh needs to be updated to serve the splits via DMCreateFieldDecomposition() correctly to petsc-3.4. Note that DMCreateFieldDecomposition() is called by PCFieldSplit from PETSc, so you wouldn't see those calls in the libMesh source.</div>
<div><br></div><div>Dmitry.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 20, 2013 at 6:35 AM, subramanya sadasiva <span dir="ltr"><<a href="mailto:potaman@outlook.com" target="_blank">potaman@outlook.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt, <br>
Libmesh does create the DM. This is the relevant code. <br>
<br>
ierr = DMCreateLibMesh(libMesh::COMM_WORLD, this->system(), &dm);CHKERRABORT(libMesh::COMM_WORLD, ierr);<br>
ierr = DMSetFromOptions(dm); CHKERRABORT(libMesh::COMM_WORLD, ierr);<br>
ierr = DMSetUp(dm); CHKERRABORT(libMesh::COMM_WORLD, ierr);<br>
ierr = SNESSetDM(this->_snes, dm); CHKERRABORT(libMesh::COMM_WORLD, ierr);<br>
<br>
I am unable to tell from the code whether the DMCreateFieldDecomposition is run at all. I will see if running in the debugger helps me figure it out.<br>
Thanks,<br>
Subramanya <br>
<br>
<br>
<br>
Date: Sat, 20 Jul 2013 06:22:30 -0500<br>
<div class="im HOEnZb">Subject: Re: [petsc-users] Trying to set up a field-split preconditioner<br>
From: <a href="mailto:knepley@gmail.com">knepley@gmail.com</a><br>
To: <a href="mailto:potaman@outlook.com">potaman@outlook.com</a><br>
CC: <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<br>
</div><div class="im HOEnZb">On Sat, Jul 20, 2013 at 6:19 AM, subramanya sadasiva <<a href="mailto:potaman@outlook.com">potaman@outlook.com</a>> wrote:<br>
Hi Matt, <br>
The DM is created by the LibMesh code. The only thing I do directly with Petsc is set the solver prefixes which libmesh doesn't have an interface for at present . I have been able to set most options directly through command line options. this is the one case where that is not helping, and it might just be that I don't know how. Let me see if I am able to get this working.<br>
<br>
So does Libmesh create the PETSc solver? If so, it should be calling KSPSetDM() or SNESSetDM() or TSSetDM(). This<br>
is all I want to know. It seems like this is not the case since the PCFIELDSPLIT says it has no fields. Either that, or they have<br>
a bug in the DMCreateFieldDecomposition() implementation.<br>
<br>
Either way, it seems like the thing to do is run with -start_in_debugger, and break in PCFieldSplitSetDefaults() where that is called.<br>
<br>
Matt<br>
<br>
<br>
Thanks, <br>
Subramanya <br>
<br>
</div><div class="im HOEnZb">Date: Sat, 20 Jul 2013 06:07:47 -0500<br>
Subject: Re: [petsc-users] Trying to set up a field-split preconditioner<br>
From: <a href="mailto:knepley@gmail.com">knepley@gmail.com</a><br>
To: <a href="mailto:potaman@outlook.com">potaman@outlook.com</a><br>
CC: <a href="mailto:libmesh-users@lists.sourceforge.net">libmesh-users@lists.sourceforge.net</a>; <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<br>
On Fri, Jul 19, 2013 at 11:50 PM, subramanya sadasiva <<a href="mailto:potaman@outlook.com">potaman@outlook.com</a>> wrote:<br>
<br>
Hi Matt, <br>
I see that there is an implementation of the interface to DMCreateFieldDecomposition.html . <br>
So does this sound right?<br>
<br>
Yes, that should automatically provide the field decomposition. Since this is not happening, something is<br>
wrong in the code. Is the DM set in your solver?<br>
<br>
1. I get index sets ,and variable names from the dm create field decomposition <br>
2. Once I have these , I create fieldsplits and name them using this.. <br>
3. And I guess I should be ready to go.. <br>
One question that remains is that the fieldsplit is created on a full matrix. However, an algorithm such as VIRS operates only on a subset of this full DM. Will the fieldsplit and preconditioner created on the full DM carry over to the subsidiary DMs?<br>
<br>
VI is still new, and I have not tested in this case, but it is supposed to work.<br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
Thanks for all the help!<br>
Subramanya <br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">Date: Fri, 19 Jul 2013 23:09:10 -0500<br>
Subject: Re: [petsc-users] Trying to set up a field-split preconditioner<br>
From: <a href="mailto:knepley@gmail.com">knepley@gmail.com</a><br>
To: <a href="mailto:potaman@outlook.com">potaman@outlook.com</a><br>
CC: <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<br>
On Fri, Jul 19, 2013 at 9:59 PM, subramanya sadasiva <<a href="mailto:potaman@outlook.com">potaman@outlook.com</a>> wrote:<br>
Hi Matt, <br>
The DM being created is here (this is from Libmesh code <br>
(petscdmlibmesh.C ) <br>
<br>
01047 { <br>
01048 PetscErrorCode ierr;<br>
01049 PetscFunctionBegin;<br>
01050 ierr = DMCreate(comm, dm); CHKERRQ(ierr);<br>
01051 ierr = DMSetType(*dm, DMLIBMESH); CHKERRQ(ierr);<br>
01052 ierr = DMLibMeshSetSystem(*dm, sys); CHKERRQ(ierr);<br>
01053 PetscFunctionReturn(0);<br>
01054 }<br>
<br>
<br>
This file has methods to access the variables assigned to the DM (this seems to be stored in a struct.) <br>
So , I guess one should be able to add a bit of code to create sections as you mentioned somewhere around here. <br>
<br>
Okay, they have their own DM. It must implement one of the interfaces for field specification. They could provide<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateFieldDecomposition.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateFieldDecomposition.html</a><br>
<br>
or at a lower level<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateSubDM.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateSubDM.html</a><br>
<br>
which in turn can be constructed by specifying a default PetscSection<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMSetDefaultSection.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMSetDefaultSection.html</a><br>
<br>
Matt<br>
<br>
Thanks, <br>
Subramanya <br>
<br>
<br>
<br>
<br>
<br>
Date: Fri, 19 Jul 2013 21:33:11 -0500<br>
Subject: Re: [petsc-users] Trying to set up a field-split preconditioner<br>
From: <a href="mailto:knepley@gmail.com">knepley@gmail.com</a><br>
To: <a href="mailto:potaman@outlook.com">potaman@outlook.com</a><br>
CC: <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<br>
On Fri, Jul 19, 2013 at 9:17 PM, subramanya sadasiva <<a href="mailto:potaman@outlook.com">potaman@outlook.com</a>> wrote:<br>
Hi Matt, <br>
I am using Libmesh so the DM stuff is actually in the background, and unfortunately the matrix doesn't have a saddle point, <br>
I thought that <br>
<br>
-ch_solve_fieldsplit_block_size 2<br>
-ch_solve_fieldsplit_0_fields 0<br>
-ch_solve_fieldsplit_1_fields 1<br>
<br>
The block_size argument presumes you are using a DA. Are you?<br>
<br>
The other two options just say select the first DM field as field 0 in this PC, and the same with the second field. The<br>
DM must inform the PC about the initial field decomposition.<br>
<br>
would inform the solver of the structure. If this doesn't work owing to the fact that the problem is only being solved on a section of the mesh (because of the reduced space method), I guess I will have to use the PetscSection. Does that sound right?<br>
<br>
First, I think the right people to do this are the Libmesh people (we will of course help them). Second, you have not said<br>
whether you are using a structured or unstructured mesh. What DM class does the solver actually see?<br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
Thanks, <br>
Subramanya <br>
<br>
<br>
Subject: Re: [petsc-users] Trying to set up a field-split preconditioner<br>
From: <a href="mailto:knepley@gmail.com">knepley@gmail.com</a><br>
To: <a href="mailto:potaman@outlook.com">potaman@outlook.com</a><br>
CC: <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>; <a href="mailto:libmesh-users@lists.sourceforge.net">libmesh-users@lists.sourceforge.net</a><br>
<br>
On Fri, Jul 19, 2013 at 7:56 PM, subramanya sadasiva <<a href="mailto:potaman@outlook.com">potaman@outlook.com</a>> wrote:<br>
Hi, <br>
I am trying to set up a fieldsplit preconditioner for my Cahn Hilliard solver and I get the following error, <br>
<br>
You have to tell the PCFIELDSPLIT about the dofs in each field. So<br>
<br>
1) You are probably not using a DA, since it would tell it automatically<br>
<br>
2) If you have a saddle point, you can use -pc_fieldsplit_detect_saddle_point<br>
<br>
3) If none of those apply, you can set a PetscSection describing your layout to the DM for the solver.<br>
Since this is new, I suspect you will need help, so mail back.<br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
<br>
[0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[0]PETSC ERROR: Petsc has generated inconsistent data!<br>
[0]PETSC ERROR: Unhandled case, must have at least two fields, not 0!<br>
[0]PETSC ERROR: ------------------------------------------------------------------------<br>
<br>
These are the options that I am using, <br>
-ch_solve is just a prefix. <br>
<br>
<br>
<br>
-ch_solve_pc_type fieldsplit<br>
-ch_solve_pc_fieldsplit_type schur<br>
-ch_solve_fieldsplit_block_size 2<br>
-ch_solve_fieldsplit_0_field 1<br>
-ch_solve_fieldsplit_1_field 0<br>
-ch_solve_fieldsplit_0_ksp_type cg <br>
-ch_solve_fieldsplit_0_pc_type hypre<br>
-ch_solve_fieldsplit_0_pc_type_hypre boomeramg <br>
-ch_solve_fieldsplit_1_ksp_type cg<br>
-ch_solve_fieldsplit_1_pc_type hypre <br>
-ch_solve_fieldsplit_1_pc_type_hypre boomeramg<br>
<br>
Any ideas?<br>
<br>
Thanks,<br>
Subramanya <br>
<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
<br>
<br>
<br>
--<br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener </div></div></blockquote></div><br></div><br clear="all"><div><br></div><br></div>