<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Jed: To you think that I can write a
work-around in just using PetscOptionsInsertString before KSPSetUp
with some settings that I don't will use later but which would
make KSPSetUp on the corresponding solver object cheap?<br>
<br>
Thomas<br>
<br>
Am 19.11.2012 09:48, schrieb Jed Brown:<br>
</div>
<blockquote
cite="mid:CAM9tzS=c44U_ficTotVgVL7JOQuWYE+Y5cL0njCG3AxjQ_FJVw@mail.gmail.com"
type="cite">Unfortunately, options are currently the only way to
avoid the initial setup. We could add a special setup routine to
the PCFieldSplit interface that you could call, but there are lots
of other PCs that you sometimes want to reconfigure after "partial
setup". I've been unhappy with this for years, but have not found
a general and maintainable way to support, and configuration via
options is a better approach most of the time.
<div class="gmail_extra">
<br>
<br>
<div class="gmail_quote">On Mon, Nov 19, 2012 at 2:29 AM, Thomas
Witkowski <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:thomas.witkowski@tu-dresden.de"
target="_blank">thomas.witkowski@tu-dresden.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">In the
implementation of my Navier-Stokes solver, I initialize the
PCFieldSplit preconditioner in my source code (thus not on
the command line) in the following way:<br>
<br>
PCSetType(pc, PCFIELDSPLIT);<br>
PCFieldSplitSetType(pc, PC_COMPOSITE_SCHUR);<br>
PCFieldSplitSetSchurFactType(pc,
PC_FIELDSPLIT_SCHUR_FACT_FULL);<br>
...<br>
KSPSetUp(ksp);<br>
KSP *subKsp;<br>
PetscInt nSubKsp;<br>
PCFieldSplitGetSubKSP(pc, &nSubKsp, &subKsp);<br>
KSP kspVelocity = subKsp[0];<br>
KSP kspSchur = subKsp[1];<br>
...<br>
<br>
And then kspVelocity and kspSchur are filled with
appropriate options. The point is now, that to get the sub
solver objects, I have to run KSPSetUp before. In this case,
the sub solver objects are also initialized with some
predefined options (block jacobi ILU), which I don't need
and what takes some time and memory. Is there any other way
to get the sub solver objects before and to initialize than
the outer solver correctly with the inner solver I have
specified?<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Thomas<br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>