IFEM  90A354
Public Member Functions | Protected Attributes | Private Types | Private Attributes | List of all members
AdaptiveSetup Class Reference

Adaptive solution setup for linear and nonlinear FEM simulators. More...

#include <AdaptiveSetup.h>

Inheritance diagram for AdaptiveSetup:
Inheritance graph
[legend]
Collaboration diagram for AdaptiveSetup:
Collaboration graph
[legend]

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

SIMoutputmodel
 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.
 
ScalarFuncbetaFunc
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AdaptiveSetup()

AdaptiveSetup::AdaptiveSetup ( SIMoutput sim,
bool  sa = true 
)
explicit

The constructor initializes default adaptation parameters.

Parameters
simThe FE model
[in]saIf 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.

Member Function Documentation

◆ calcRefinement()

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.

Parameters
[out]prmMesh refinement control data
[in]iStepRefinement step counter
[in]gNormGlobal norms
[in]refInElement refinement indicators (element error norms)
[in]currDofsCurrent number of model DOFs. -1 to use SIMbase::getNoDOFs()
Returns
Number of elements to be refined
If zero, no refinement needed
Negative value on error

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().

◆ initPrm()

bool AdaptiveSetup::initPrm ( size_t  normGroup)

Initializes the norm group parameters.

Parameters
[in]normGroupIndex 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().

◆ parse() [1/2]

bool AdaptiveSetup::parse ( char *  keyWord,
std::istream &  is 
)

Parses a data section from an input stream.

Parameters
[in]keyWordKeyword of current data section to read
isThe file stream to read from

References beta, errTol, knot_mult, maxDOFs, maxStep, model, SIMoutput::parse(), utl::readLine(), and scheme.

Referenced by AdaptiveSIM::parse().

◆ parse() [2/2]

bool AdaptiveSetup::parse ( const tinyxml2::XMLElement *  elem)

◆ printNorms()

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.

Parameters
[in]gNormGlobal norms
[in]dNormGlobal dual norms
[in]eNormElement norms
[in]wField width for global norm labels
[in]printModelNormsTrue 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().

◆ writeMesh()

bool AdaptiveSetup::writeMesh ( int  iStep) const

Dumps current mesh to external file(s) for inspection.

Parameters
[in]iStepCurrent refinement step (1=initial grid)

References SIMoutput::dumpGeometry(), SIMbase::getFEModel(), SIMbase::getNoPatches(), model, mshPrefix, and storeMesh.

Referenced by AdaptiveSIM::adaptMesh(), and AdaptiveSIM::solveStep().


The documentation for this class was generated from the following files: