|
IFEM
90A354
|
Adaptive solution setup for linear and nonlinear FEM simulators. More...
#include <AdaptiveSetup.h>


Public Member Functions | |
| AdaptiveSetup (SIMoutput &sim, bool sa=true) | |
| The constructor initializes default adaptation parameters. More... | |
| virtual | ~AdaptiveSetup () |
| Empty destructor. | |
| void | setAdaptationNorm (size_t g, size_t i=0) |
| Sets the norm group/index of the norm to base mesh adaptation on. | |
| bool | initPrm (size_t normGroup) |
| Initializes the norm group parameters. More... | |
| int | calcRefinement (LR::RefineData &prm, int iStep, const Vectors &gNorm, const Vector &refIn, int currDofs=-1) const |
| Calculates mesh refinement control data based on error estimates. More... | |
| bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
| void | printNorms (const Vectors &gNorm, const Vectors &dNorm, const Matrix &eNorm, size_t w=36, bool printModelNorms=true) const |
| Prints out global norms to the log stream. More... | |
| bool | writeMesh (int iStep) const |
| Dumps current mesh to external file(s) for inspection. More... | |
| size_t | eIdx () const |
| Returns the row-index of the element norm to use for adaptation. | |
Protected Attributes | |
| SIMoutput & | model |
| The isogeometric FE model. | |
| size_t | adaptor |
| Norm group to base the mesh adaptation on. | |
| size_t | adNorm |
| Which norm to base the mesh adaptation on. | |
| size_t | eRow |
| Row-index in eNorm of the norm to use for adaptation. | |
| double | rCond |
| Actual reciprocal condition number of the last mesh. | |
Private Types | |
| enum | Threshold { NONE =0 , MAXIMUM , AVERAGE , MINIMUM , TRUE_BETA , DORFEL , SYMMETRIZED } |
| Enum defining the refinement threshold flag values. | |
| enum | RefScheme { FULLSPAN =0 , MINSPAN =1 , ISOTROPIC_FUNCTION =2 , ISOTROPIC_ELEMENT =3 } |
| Enum defining available refinement scheme options. | |
Private Attributes | |
| bool | alone |
| If false, this class is wrapped by SIMSolver. | |
| bool | linIndep |
| Test mesh for linear independence after refinement. | |
| double | beta |
| Refinement percentage in each step. | |
| ScalarFunc * | betaFunc |
| Beta as a function. | |
| double | errTol |
| Global error stop tolerance. | |
| double | condLimit |
| Upper limit on condition number. | |
| int | maxStep |
| Maximum number of adaptive refinements. | |
| int | maxDOFs |
| Maximum number of degrees of freedom. | |
| int | knot_mult |
| Knotline multiplicity. | |
| int | maxTjoints |
| Maximum number of hanging nodes on one element. | |
| double | maxAspect |
| Maximum element aspect ratio. | |
| bool | closeGaps |
| Split elements with a hanging node on each side. | |
| double | symmEps |
| Epsilon used for symmetrized selection method. | |
| Threshold | threshold |
| Flag for how to interpret the parameter beta. | |
| RefScheme | scheme |
| The actual refinement scheme to use. | |
| int | storeMesh |
| Flag telling what kind of mesh output we want. | |
| std::string | mshPrefix |
| Prefix for output files with refined meshes. | |
| std::string | errPrefix |
| Prefix for text files with refinement indicators. | |
Adaptive solution setup for linear and nonlinear FEM simulators.
This class contains parameters for controlling the mesh refinement in an adaptive simulation procedure, with methods for parsing the parameters from the input file and to calculate the actual refinement indicators to be passed to the LR-spline based mesh refinement methods. It also has methods for printing out the global error norms that are used in the mesh-refinement calculation, and for dumping the refined meshes to files in different formats.
|
explicit |
The constructor initializes default adaptation parameters.
| sim | The FE model | |
| [in] | sa | If true, this is a stand-alone driver |
References adaptor, adNorm, beta, betaFunc, closeGaps, condLimit, eRow, errTol, knot_mult, linIndep, maxAspect, maxDOFs, maxStep, maxTjoints, rCond, scheme, storeMesh, symmEps, and threshold.
| int AdaptiveSetup::calcRefinement | ( | LR::RefineData & | prm, |
| int | iStep, | ||
| const Vectors & | gNorm, | ||
| const Vector & | refIn, | ||
| int | currDofs = -1 |
||
| ) | const |
Calculates mesh refinement control data based on error estimates.
| [out] | prm | Mesh refinement control data |
| [in] | iStep | Refinement step counter |
| [in] | gNorm | Global norms |
| [in] | refIn | Element refinement indicators (element error norms) |
| [in] | currDofs | Current number of model DOFs. -1 to use SIMbase::getNoDOFs() |
References adaptor, adNorm, beta, betaFunc, GlobalNodes::calcGlobalNodes(), LR::RefineData::clear(), closeGaps, condLimit, IFEM::cout, LR::RefineData::elements, utl::vector< T >::empty(), epsZ, error(), LR::RefineData::errors, errPrefix, errTol, SIMbase::getFEModel(), SIMinput::getInterfaces(), SIMbase::getNoDOFs(), SIMbase::getNoPatches(), ASMbase::getNoRefineElms(), ASMbase::getNoRefineNodes(), SIMbase::getPatch(), SIMoutput::getReferenceNorm(), ASMLRSpline::getRefinementBasis(), SIMbase::haveAnaSol(), knot_mult, linIndep, maxAspect, maxDOFs, maxStep, maxTjoints, LR::RefineData::MLGN, model, LR::RefineData::options, rCond, scheme, utl::vector< T >::size(), symmEps, and threshold.
Referenced by AdaptiveSIM::adaptMesh().
| bool AdaptiveSetup::initPrm | ( | size_t | normGroup | ) |
Initializes the norm group parameters.
| [in] | normGroup | Index to the norm group to base mesh adaptation on |
References adaptor, adNorm, IFEM::cout, eRow, NormBase::getNoFields(), SIMbase::getNormIntegrand(), SIMbase::haveAnaSol(), model, SIMadmin::opt, and SIMoptions::project.
Referenced by AdaptiveSIM::initAdaptor().
| bool AdaptiveSetup::parse | ( | char * | keyWord, |
| std::istream & | is | ||
| ) |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
References beta, errTol, knot_mult, maxDOFs, maxStep, model, SIMoutput::parse(), utl::readLine(), and scheme.
Referenced by AdaptiveSIM::parse().
| bool AdaptiveSetup::parse | ( | const tinyxml2::XMLElement * | elem | ) |
Parses a data section from an XML document.
| [in] | elem | The XML element to parse |
References adaptor, adNorm, alone, beta, betaFunc, closeGaps, condLimit, IFEM::cout, errPrefix, errTol, utl::getAttribute(), utl::getValue(), knot_mult, linIndep, maxAspect, maxDOFs, maxStep, maxTjoints, model, mshPrefix, SIMoutput::parse(), utl::parseTimeFunc(), scheme, storeMesh, symmEps, and threshold.
| void AdaptiveSetup::printNorms | ( | const Vectors & | gNorm, |
| const Vectors & | dNorm, | ||
| const Matrix & | eNorm, | ||
| size_t | w = 36, |
||
| bool | printModelNorms = true |
||
| ) | const |
Prints out global norms to the log stream.
| [in] | gNorm | Global norms |
| [in] | dNorm | Global dual norms |
| [in] | eNorm | Element norms |
| [in] | w | Field width for global norm labels |
| [in] | printModelNorms | True to print norms for model |
References adaptor, utl::adjustRight(), adNorm, utl::matrix< T >::cols(), IFEM::cout, eRow, SIMoutput::getEffectivityIndex(), NormBase::getName(), SIMbase::getNormIntegrand(), SIMoutput::getReferenceNorm(), SIMbase::haveAnaSol(), model, SIMoutput::printNorms(), and utl::matrix< T >::rows().
Referenced by AdaptiveSIM::adaptMesh().
| bool AdaptiveSetup::writeMesh | ( | int | iStep | ) | const |
Dumps current mesh to external file(s) for inspection.
| [in] | iStep | Current refinement step (1=initial grid) |
References SIMoutput::dumpGeometry(), SIMbase::getFEModel(), SIMbase::getNoPatches(), model, mshPrefix, and storeMesh.
Referenced by AdaptiveSIM::adaptMesh(), and AdaptiveSIM::solveStep().