<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks Matt,<br>
this indeed setting the number of fields earlier solve my issue!<br>
<br>
I have now made some progress getting my DM setup but I am having
troubles setting my splitfield options.<br>
I ran my problem with the -ksp_view option to see what is going on
and I guess that somehow the section that I define in my DM is not
used by the preconditioner to split the fields.<br>
Here is the output of PETSc<br>
<br>
<font face="Helvetica, Arial, sans-serif">KSP Object: 1 MPI
processes<br>
type: gmres<br>
GMRES: restart=30, using Classical (unmodified) Gram-Schmidt
Orthogonalization with no iterative refinement<br>
GMRES: happy breakdown tolerance 1e-30<br>
maximum iterations=10000, initial guess is zero<br>
tolerances: relative=1e-08, absolute=1e-16, divergence=1e+16<br>
left preconditioning<br>
using PRECONDITIONED norm type for convergence test<br>
PC Object: 1 MPI processes<br>
type: fieldsplit<br>
FieldSplit with MULTIPLICATIVE composition: total splits = 4<br>
Solver info for each split is in the following KSP objects:<br>
Split number 0 Defined by IS<br>
KSP Object: (fieldsplit_Field_0_) 1 MPI processes<br>
type: preonly<br>
maximum iterations=10000, initial guess is zero<br>
tolerances: relative=1e-05, absolute=1e-50,
divergence=10000<br>
left preconditioning<br>
using NONE norm type for convergence test<br>
PC Object: (fieldsplit_Field_0_) 1 MPI processes<br>
type: ilu<br>
ILU: out-of-place factorization<br>
0 levels of fill<br>
tolerance for zero pivot 2.22045e-14<br>
using diagonal shift on blocks to prevent zero pivot<br>
matrix ordering: natural<br>
factor fill ratio given 1, needed 1<br>
Factored matrix follows:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
package used to perform factorization: petsc<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues
calls =0<br>
not using I-node routines<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues calls
=0<br>
not using I-node routines<br>
Split number 1 Defined by IS<br>
KSP Object: (fieldsplit_Field_1_) 1 MPI processes<br>
type: preonly<br>
maximum iterations=10000, initial guess is zero<br>
tolerances: relative=1e-05, absolute=1e-50,
divergence=10000<br>
left preconditioning<br>
using NONE norm type for convergence test<br>
PC Object: (fieldsplit_Field_1_) 1 MPI processes<br>
type: ilu<br>
ILU: out-of-place factorization<br>
0 levels of fill<br>
tolerance for zero pivot 2.22045e-14<br>
using diagonal shift on blocks to prevent zero pivot<br>
matrix ordering: natural<br>
factor fill ratio given 1, needed 1<br>
Factored matrix follows:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
package used to perform factorization: petsc<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues
calls =0<br>
not using I-node routines<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues calls
=0<br>
not using I-node routines<br>
Split number 2 Defined by IS<br>
KSP Object: (fieldsplit_Field_2_) 1 MPI processes<br>
type: preonly<br>
maximum iterations=10000, initial guess is zero<br>
tolerances: relative=1e-05, absolute=1e-50,
divergence=10000<br>
left preconditioning<br>
using NONE norm type for convergence test<br>
PC Object: (fieldsplit_Field_2_) 1 MPI processes<br>
type: ilu<br>
ILU: out-of-place factorization<br>
0 levels of fill<br>
tolerance for zero pivot 2.22045e-14<br>
using diagonal shift on blocks to prevent zero pivot<br>
matrix ordering: natural<br>
factor fill ratio given 1, needed 1<br>
Factored matrix follows:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
package used to perform factorization: petsc<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues
calls =0<br>
not using I-node routines<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues calls
=0<br>
not using I-node routines<br>
Split number 3 Defined by IS<br>
KSP Object: (fieldsplit_Field_3_) 1 MPI processes<br>
type: preonly<br>
maximum iterations=10000, initial guess is zero<br>
tolerances: relative=1e-05, absolute=1e-50,
divergence=10000<br>
left preconditioning<br>
using NONE norm type for convergence test<br>
PC Object: (fieldsplit_Field_3_) 1 MPI processes<br>
type: ilu<br>
ILU: out-of-place factorization<br>
0 levels of fill<br>
tolerance for zero pivot 2.22045e-14<br>
using diagonal shift on blocks to prevent zero pivot<br>
matrix ordering: natural<br>
factor fill ratio given 1, needed 1<br>
Factored matrix follows:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
package used to perform factorization: petsc<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues
calls =0<br>
not using I-node routines<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=0, cols=0<br>
total: nonzeros=0, allocated nonzeros=0<br>
total number of mallocs used during MatSetValues calls
=0<br>
not using I-node routines<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqaij<br>
rows=16, cols=16<br>
total: nonzeros=256, allocated nonzeros=256<br>
total number of mallocs used during MatSetValues calls =0<br>
using I-node routines: found 4 nodes, limit used is 5</font><br>
<br>
I am also attaching part of my code which I use to generate the
DM, the KSP and the PC objects.<br>
<pre class="moz-signature" cols="72">Best,
Luc</pre>
On 01/25/2014 10:31 AM, Matthew Knepley wrote:<br>
</div>
<blockquote
cite="mid:CAMYG4GmDBs9TcCmrVdkT9xnDr2X2KgGSFFv21WcsC8tJF=pn-w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Jan 24, 2014 at 5:10 PM, Luc
Berger-Vergiat <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:lb2653@columbia.edu"
target="_blank">lb2653@columbia.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
I want to use PETSc as a solver for an FEM problem:
modelization of shear bands using a 4 fields mixed
formulation.<br>
<br>
So far I am just trying to set up a two fields in a Petsc
section, assign dof too each field and then set up the
section to pass it to a DM. I am taking this approach
because in general I want for fieldsplit to work purely on
the algebraic level without knowledge of boundary
conditions or geometry.<br>
<br>
As of now I have issues when I try to assign a point and
its associated degree of freedom to a field using:
PetscSectionSetFieldDof.<br>
Is this the correct way to associate a dof/point to a
field?<br>
</blockquote>
<div><br>
</div>
<div>You have to set the number of fields before the chart.
I am updating the docs.</div>
<div><br>
</div>
<div> Thanks,</div>
<div>
<br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
I attached an example code and its makefile.<span
class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Best,<br>
Luc<br>
<br>
</font></span></blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <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>
<br>
</body>
</html>