|
IFEM
90A354
|
Adaptive solution driver for linear static FEM simulators. More...
#include <AdaptiveSIM.h>


Public Member Functions | |
| AdaptiveSIM (SIMoutput &sim, bool sa=true) | |
| The constructor initializes default adaptation parameters. More... | |
| virtual | ~AdaptiveSIM () |
| Empty destructor. | |
| bool | initAdaptor (size_t normGroup=0) |
| Initializes the projs and prefix arrays. More... | |
| bool | solveStep (const char *inputfile, int iStep, bool withRF=false, std::streamsize precision=6) |
| Assembles and solves the linear FE equations on current mesh. More... | |
| bool | adaptMesh (int iStep, std::streamsize outPrec=0) |
| Refines the current mesh based on the element norms. More... | |
| bool | adaptMesh (int iStep, Vectors &sol, std::streamsize outPrec=0) |
| Refines the current mesh based on the element norms. More... | |
| bool | writeGlv (const char *infile, int iStep) |
| Writes current mesh and results to the VTF-file. More... | |
| const Vector & | getSolution (size_t idx=0) const |
| Accesses the solution of the linear system. | |
| const Vector & | getProjection (size_t idx=0) const |
| Accesses the projections. | |
| const Vectors & | getProjections () const |
| Access all the projections. | |
| const Matrix & | getEnorm () const |
| Access the calculated element-wise norms. | |
| virtual bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| virtual bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
| virtual bool | preprocessC (const IntVec &ignored, bool fixDup, double time0) |
| Performs some pre-processing tasks on the FE model. More... | |
Public Member Functions inherited from SIMadmin | |
| virtual | ~SIMadmin () |
| Empty destructor. | |
| virtual bool | read (const char *fileName) |
| Reads model data from the specified input file *fileName. | |
| virtual bool | preprocess (const IntVec &ignored={}, bool fixDup=false) |
| Performs some pre-processing tasks on the FE model. | |
| const ProcessAdm & | getProcessAdm () const |
| Returns the parallel process administrator. | |
| int | getGlobalProcessID () const |
| Returns the global process ID. More... | |
| const std::string & | getHeading () const |
| Returns the simulator heading. | |
| void | setHeading (const std::string &heading) |
| Defines the simulator heading. | |
| void | printHeading (int &supStep) const |
| Prints the heading of this simulator, if any, to IFEM::cout. | |
Public Member Functions inherited from XMLInputBase | |
| bool | readXML (const char *fileName, bool verbose=true) |
| Reads an XML input file. More... | |
| bool | loadXML (const char *xml) |
| Loads data from an XML-formatted text string. More... | |
Public Member Functions inherited from AdaptiveSetup | |
| 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 Member Functions | |
| virtual bool | assembleAndSolveSystem () |
| Assembles and solves the linear FE equation system. | |
| virtual bool | savePoints (int iStep) const |
| Saves point results to output file for a given refinement step. More... | |
Protected Member Functions inherited from SIMadmin | |
| SIMadmin (const char *heading=nullptr) | |
| The default constructor initializes the process administrator. | |
| SIMadmin (SIMadmin &anotherSIM) | |
| Copy constructor. | |
Protected Member Functions inherited from XMLInputBase | |
| const tinyxml2::XMLElement * | loadFile (tinyxml2::XMLDocument &doc, const char *fileName, bool verbose=false) |
| Loads an XML input file into a tinyxml2::XMLDocument object. More... | |
| virtual const char ** | getPrioritizedTags () const |
| Returns a list of prioritized XML-tags. | |
Protected Attributes | |
| Vectors | solution |
| All solutions (including Galerkin projections) | |
Protected Attributes inherited from SIMadmin | |
| ProcessAdm | adm |
| Parallel administrator. | |
| int | myPid |
| Processor ID in parallel simulations. | |
| int | nProc |
| Number of processors in parallel simulations. | |
| std::string | myHeading |
| Heading written before reading the input file. | |
Protected Attributes inherited from AdaptiveSetup | |
| 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 Attributes | |
| Vectors | gNorm |
| Global norms. | |
| Vectors | dNorm |
| Dual global norms. | |
| Matrix | eNorm |
| Element norms. | |
| Matrix | fNorm |
| Dual element norms. | |
| int | geoBlk |
| Running VTF geometry block counter. | |
| int | nBlock |
| Running VTF result block counter. | |
| std::vector< Vector > | projs |
| Projected secondary solutions. | |
| std::vector< Vector > | projd |
| Projected dual solutions. | |
| std::vector< std::string > | prefix |
| Norm prefices for VTF-output. | |
Additional Inherited Members | |
Public Attributes inherited from SIMadmin | |
| SIMoptions & | opt |
| Simulation control parameters. | |
Static Public Attributes inherited from SIMadmin | |
| static int | msgLevel = 2 |
| Controls the console output amount during solving. | |
Protected Types inherited from SIMadmin | |
| using | IntVec = std::vector< int > |
| Convenience alias. | |
Adaptive solution driver for linear static FEM simulators.
This class contains data and methods for solving linear static FE problems adaptively, based on element error norms as refinement indicators.
|
explicit |
| bool AdaptiveSIM::adaptMesh | ( | int | iStep, |
| std::streamsize | outPrec = 0 |
||
| ) |
Refines the current mesh based on the element norms.
| [in] | iStep | Refinement step counter |
| [in] | outPrec | Number of digits after the decimal point in norm print |
Referenced by AdaptiveISolver< T1, SolutionTransfer >::adaptMesh().
| bool AdaptiveSIM::adaptMesh | ( | int | iStep, |
| Vectors & | sol, | ||
| std::streamsize | outPrec = 0 |
||
| ) |
Refines the current mesh based on the element norms.
| [in] | iStep | Refinement step counter |
| sol | Vectors for solution transfer | |
| [in] | outPrec | Number of digits after the decimal point in norm print |
References AdaptiveSetup::calcRefinement(), IFEM::cout, dNorm, utl::matrixBase< T >::empty(), eNorm, AdaptiveSetup::eRow, fNorm, utl::matrix< T >::getRow(), gNorm, AdaptiveSetup::model, utl::LogStream::precision(), AdaptiveSetup::printNorms(), SIMinput::refine(), and AdaptiveSetup::writeMesh().
| bool AdaptiveSIM::initAdaptor | ( | size_t | normGroup = 0 | ) |
Initializes the projs and prefix arrays.
| [in] | normGroup | Index to the norm group to base mesh adaptation on |
References SIMoptions::format, SIMbase::haveDualSol(), AdaptiveSetup::initPrm(), AdaptiveSetup::model, SIMadmin::opt, prefix, projd, SIMoptions::project, and projs.
|
virtual |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
Reimplemented from SIMadmin.
References AdaptiveSetup::parse().
|
virtual |
Parses a data section from an XML document.
| [in] | elem | The XML element to parse |
Reimplemented from SIMadmin.
References AdaptiveSetup::parse().
|
virtual |
Performs some pre-processing tasks on the FE model.
| [in] | ignored | Indices of patches to be ignored in the analysis |
| [in] | fixDup | Merge duplicated FE nodes on patch interfaces? |
| [in] | time0 | Initial time for time-dependent dirichlet conditions |
Reimplemented from SIMadmin.
References AdaptiveSetup::model, and SIMbase::preprocessC().
|
protectedvirtual |
Saves point results to output file for a given refinement step.
| [in] | iStep | Refinement step counter |
By default, this method just forwards to the underlying model.
Reimplemented in AdaptiveISolver< T1, SolutionTransfer >.
References AdaptiveSetup::model, SIMoutput::savePoints(), and solution.
Referenced by solveStep().
| bool AdaptiveSIM::solveStep | ( | const char * | inputfile, |
| int | iStep, | ||
| bool | withRF = false, |
||
| std::streamsize | precision = 6 |
||
| ) |
Assembles and solves the linear FE equations on current mesh.
| [in] | inputfile | File to read model parameters from after refinement |
| [in] | iStep | Refinement step counter |
| [in] | withRF | Whether nodal reaction forces should be computed or not |
| [in] | precision | Number of digits after decimal point |
References AdaptiveSetup::adaptor, assembleAndSolveSystem(), utl::matrixBase< T >::clear(), SIMoutput::clearProperties(), utl::matrix< T >::cols(), ProcessAdm::cout, dNorm, SIMoutput::dumpResults(), eNorm, AdaptiveSetup::eRow, fNorm, SIMoptions::format, geoBlk, SIMbase::getNoRHS(), SIMadmin::getProcessAdm(), gNorm, SIMbase::initSystem(), AdaptiveSetup::model, SIMadmin::msgLevel, SIMoptions::nGauss, SIMadmin::opt, SIMadmin::preprocess(), projd, SIMbase::project(), SIMoptions::project, projs, SIMadmin::read(), utl::matrix< T >::rows(), savePoints(), SIMbase::setMode(), SIMbase::setQuadratureRule(), solution, SIMbase::solutionNorms(), SIMoptions::solver, SIMoutput::writeGlvG(), SIMoutput::writeGlvStep(), and AdaptiveSetup::writeMesh().
| bool AdaptiveSIM::writeGlv | ( | const char * | infile, |
| int | iStep | ||
| ) |
Writes current mesh and results to the VTF-file.
| [in] | infile | File name used to construct the VTF-file name from |
| [in] | iStep | Refinement step counter |
References utl::matrixBase< T >::empty(), eNorm, fNorm, SIMoptions::format, geoBlk, AdaptiveSetup::model, nBlock, SIMadmin::opt, prefix, SIMoptions::project, projs, SIMbase::setMode(), solution, SIMoutput::writeGlvBC(), SIMoutput::writeGlvG(), SIMoutput::writeGlvN(), SIMoutput::writeGlvP(), SIMoutput::writeGlvS(), SIMoutput::writeGlvS1(), SIMoutput::writeGlvStep(), and SIMoutput::writeGlvT().