Simple interface - field without calculation

17 views
Skip to first unread message
Assigned to inz.karol...@gmail.com by lik...@wp.pl

kulikova.adriana

unread,
Dec 9, 2021, 10:56:23 AM12/9/21
to MoFEM Q&A
Hello,

I would like to have a field "pFieldPrev" which only copied values of "pField" and is not calculated otherwise. If I add it in the following way, the KSP does not converge (I add the order, etc., and everything compiles):

CHKERR simpleInterface->addDomainField(pFieldPrev, H1, AINSWORTH_LEGENDRE_BASE, 1);

I assume it is trying to calculate the pFieldPrev field since it is included in the following:
CHKERR DMoFEMLoopFiniteElements(dM, simpleInterface->getDomainFEName(), feDomainLhsPtr);

Is there a specific way to do this in simple interface or should I create it on the side?
I would still like to be able to print the field and use it for calculations in the following iteration.

Thanks,

Adriana

Karol Lewandowski

unread,
Dec 9, 2021, 10:59:20 AM12/9/21
to MoFEM Q&A
I guess you want to add data field, not domain field
use this function from the simple 

  MoFEMErrorCode addDataField(const std::string &name, const FieldSpace space,
                              const FieldApproximationBase base,
                              const FieldCoefficientsNumber nb_of_coefficients,
                              const TagType tag_type = MB_TAG_SPARSE,
                              const enum MoFEMTypes bh = MF_ZERO,
                              int verb = -1);

Karol Lewandowski

unread,
Dec 9, 2021, 11:01:24 AM12/9/21
to MoFEM Q&A
The difference is that the domain field will add dofs to the problem and without filling them, yes KSP can struggle to converge because you added a bunch of zeroes to your problem. 

kulikova.adriana

unread,
Dec 9, 2021, 11:20:58 AM12/9/21
to MoFEM Q&A
Yes, this works nicely.

Thank you

Reply all
Reply to author
Forward
0 new messages