[petsc-dev] About PCFieldSplitGetSubKSP
Ryan Yan
vyan2000 at gmail.com
Sat May 7 23:25:26 CDT 2011
Dear Barry,
Thanks a lot for the pointer. This also reminds me the sprintf...
Yan
On Sat, May 7, 2011 at 11:34 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On May 7, 2011, at 9:12 PM, Ryan Yan wrote:
>
> > Dear All,
> > I have a question about the function call PCFieldSplitSetFields() in the
> developer version.
> >
> > I would like to name of each field separately, and using some
> > rule based on the count of i.
> >
> > For instance, I would try:
> > for (i = 0; i < m/3; i++) {
> > ierr = PCFieldSplitSetFields(pc,"0",xxx,xxx);
> > ierr = PCFieldSplitSetFields(pc,"1",xxx,xxx);
> > }
> >
> > When m=3 this is fine, since there is only one pass, namely, '0' and '1'
> is fine
> > When m=6, I want 4 fields. But how can I set up the name as '3' and '4'
> after the first pass in the loop.
> >
> > I think the question is how to fill up an char[] dynamically as a integer
> array?
>
> The standard C function scanf().
>
> Barry
>
> >
> > This might be a naive question, but I did not come up any way of doing
> it.
> >
> > Many thanks,
> >
> > Yan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110508/9679ffc4/attachment.html>
More information about the petsc-dev
mailing list