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

Solution driver for general superelement FEM analysis. More...

#include <SIMsupel.h>

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

Classes

struct  SuperElm
 Struct with superelement data. More...
 

Public Member Functions

 SIMsupel (const char *hd=nullptr, char nf=6)
 Default constructor. More...
 
virtual bool createFEMmodel (char resetNumb)
 Creates the FE topology of the superelement patches.
 
virtual std::string getName () const
 Returns the name of this simulator.
 
bool recoverInternalDOFs (const Vector &glbSol)
 Performs recovery of the internal DOFs for superelements. More...
 
- Public Member Functions inherited from SIMdummy< SIMgeneric >
virtual unsigned short int getNoParamDim () const
 Returns the number of parameter dimensions in the model.
 
virtual std::vector< std::vector< int > > getElmConnectivities () const
 Element-element connectivities.
 
- Public Member Functions inherited from SIMgeneric
virtual ~SIMgeneric ()
 Empty destructor.
 
ASMbasecreateDefaultModel ()
 Creates a model with the default geometry (line, plane, cube). More...
 
RealArray getSolution (const Vector &psol, const double *par, int deriv=0, int patch=1) const
 Evaluates the primary solution at the given point. More...
 
int evalPoint (const double *xi, Vec3 &X, double *param=nullptr, int patch=1, bool global=false) const
 Evaluates the mapping of the geometry at the given point. More...
 
RealArray getInterfaceForces (const RealArray &sf, const RealArray &weights, int code) const
 Extracts the force resultant on a specified interface. More...
 
int findElementContaining (const double *param, int patch=1, bool global=false) const
 Returns the element that contains a specified spatial point. More...
 
virtual bool calcBouForces (Real2DMat &, const Vectors &)
 Calculates surface traction resultants.
 
size_t getVCPindex (size_t idx=1) const
 Returns the norm index for the a VCP-recovered quantity.
 
virtual size_t getVolumeIndex () const
 Returns the norm index for the integrated volume (3D) or area (2D).
 
virtual void printNorms (const Vectors &gNorm, size_t w=36) const
 Prints integrated solution norms to the log stream. More...
 
virtual void printNormGroup (const Vector &, const Vector &, const std::string &) const
 Prints a norm group to the log stream (app-specific).
 
virtual double getReferenceNorm (const Vectors &gNorm, size_t adaptor) const
 Returns the reference norm to base mesh adaptation upon. More...
 
virtual double getEffectivityIndex (const Vectors &gNorm, size_t idx, size_t inorm) const
 Returns the global effectivity index. More...
 
virtual bool staticCondensation (Matrix &, Vector &)
 Interface for static condensation of the linear equation system.
 
virtual bool recoverInternals (const Vector &, Vector &)
 Interface for recovery of internal DOFs from static condensation.
 
virtual std::string getSupelName () const
 Interface for returning the superelement file name, if any.
 
virtual void dumpSupernodes (std::ostream &) const
 Interface for dumping supernode coordinates to file.
 
- Public Member Functions inherited from SIMoutput
virtual ~SIMoutput ()
 The destructor frees the dynamically allocated VTF object.
 
virtual void clearProperties ()
 Initializes the property containers of the model.
 
virtual bool parse (char *keyWord, std::istream &is)
 Parses a data section from an input stream. More...
 
virtual bool merge (SIMbase *that, const std::map< int, int > *old2new, int poff)
 Merges the global equation system of that simulator with this. More...
 
bool getElementSet (int iset, std::string &name, RealArray &elSet) const
 Retrieves the specified element set as a scalar field. More...
 
virtual bool writeGlvG (int &nBlock, const char *inpFile, bool doClear=true)
 Writes current model geometry to the VTF-file. More...
 
bool writeGlvG (int &nBlock, double time)
 Writes current model geometry to the currently open VTF-file. More...
 
virtual bool writeGlvA (int &, int, double, int=1) const
 Writes additional, problem-specific, results to the VTF-file.
 
bool writeGlvBC (int &nBlock, int iStep=1) const
 Writes boundary conditions as scalar fields to the VTF-file. More...
 
bool writeGlvNo (int &nBlock, int &idBlock, int maxBlock=20, int iStep=1) const
 Writes global node numbers as scalar fields to the VTF-file. More...
 
bool writeGlvT (int iStep, int &geoBlk, int &nBlock) const
 Writes boundary tractions for a given time step to the VTF-file. More...
 
bool writeGlvV (const RealArray &vec, const char *fieldName, int iStep, int &nBlock, int idBlock=2, int ncmp=0) const
 Writes a vector field for a given load/time step to the VTF-file. More...
 
bool writeGlvS (const Vector &scl, const char *fieldName, int iStep, int &nBlock, int idBlock=2) const
 Writes a scalar field for a given load/time step to the VTF-file. More...
 
bool writeGlvS (const Vector &psol, int iStep, int &nBlock, double time=0.0, const char *pvecName=nullptr, int idBlock=10, int psolComps=0)
 Writes solution fields for a given load/time step to the VTF-file. More...
 
virtual int writeGlvS1 (const Vector &psol, int iStep, int &nBlock, double time=0.0, const char *pvecName=nullptr, int idBlock=10, int psolComps=0, bool scalarOnly=false)
 Writes primary solution for a given load/time step to the VTF-file. More...
 
virtual int writeGlvS2 (const Vector &psol, int iStep, int &nBlock, double time=0.0, int idBlock=20, int psolComps=0)
 Writes secondary solution for a load/time step to the VTF-file. More...
 
bool eval2ndSolution (const Vector &psol, double time, int psolComps=0)
 Evaluates the secondary solution for a given load/time step. More...
 
bool writeGlvP (const RealArray &ssol, int iStep, int &nBlock, int idBlock=100, const char *prefix="Global projected", std::vector< PointValues > *maxVal=nullptr)
 Writes projected solutions for a given time step to the VTF-file. More...
 
bool writeGlvM (const Mode &mode, bool freq, int &nBlock)
 Writes a mode shape to the VTF-file. More...
 
bool writeGlvE (const Vector &field, int iStep, int &nBlock, const char *name, int idBlock=300, bool internalOrder=false) const
 Writes element field for a given load/time step to the VTF-file. More...
 
bool writeGlvN (const Matrix &norms, int iStep, int &nBlock, const std::vector< std::string > &prefix={}, int idBlock=200, const char *dualPrefix=nullptr)
 Writes element norms for a given load/time step to the VTF-file. More...
 
bool writeGlvF (const RealFunc &f, const char *fname, int iStep, int &nBlock, const Vector *state=nullptr, int idBlock=50, double time=0.0, const ASMbase *patch=nullptr)
 Writes a scalar function to the VTF-file. More...
 
bool writeGlvStep (int iStep, double value=0.0, int itype=0)
 Writes load/time step info to the VTF-file. More...
 
void closeGlv ()
 Closes the current VTF-file.
 
VTFgetVTF () const
 Returns the current VTF-file object.
 
void setVTF (VTF *vtf)
 Defines the VTF-file for subsequent results output.
 
int getStartGeo () const
 Returns the initial geometry block index.
 
void setStartGeo (int gID)
 Initializes the geometry block counter.
 
bool dumpMatlabGrid (std::ostream &os, const std::string &name="IFEM_Mesh", const std::vector< std::string > &sets={}, double scale=1.0) const
 Dumps the FE model to Matlab format. More...
 
bool dumpGeometry (std::ostream &os) const
 Dumps the (possibly refined) spline geometry in g2-format. More...
 
void dumpPrimSol (const Vector &psol, utl::LogStream &os, bool withID=true) const
 Dumps the primary solution in ASCII format for inspection. More...
 
bool dumpSolution (const Vector &psol, utl::LogStream &os) const
 Dumps the entire solution in ASCII format. More...
 
bool dumpResults (const Vector &psol, double time, utl::LogStream &os, bool formatted=false, std::streamsize precision=3) const
 Dumps solution results at specified points in ASCII format. More...
 
bool dumpVector (const Vector &vsol, const char *fname, utl::LogStream &os, std::streamsize precision=3) const
 Dumps vector solution at specified points in ASCII format. More...
 
virtual void dumpMoreResults (double, utl::LogStream &, std::streamsize=3) const
 Dumps additional problem-specific results in ASCII format.
 
bool savePoints (const Vector &psol, double time, int step) const
 Saves point results to output file for a given time step. More...
 
bool saveResults (const Vectors &psol, double time, int step) const
 Saves result components to output files for a given time step. More...
 
bool hasResultPoints () const
 Checks whether result points have been defined or not.
 
bool hasPointResultFile () const
 Checks whether point result files have been defined or not.
 
void setPointResultFile (const std::string &filename, bool dumpCoord=false)
 Sets the file name for result point output. More...
 
virtual bool serialize (std::map< std::string, std::string > &) const
 Serialization support.
 
virtual void printIFforces (const Vector &, RealArray &)
 Prints out interface force resultants to the log stream.
 
virtual int printNRforces (const IntVec &glbNodes={}) const
 Prints out the nodal reaction forces to the log stream.
 
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...
 
- Public Member Functions inherited from SIMinput
virtual ~SIMinput ()
 Empty destructor.
 
virtual const char ** getPrioritizedTags () const
 Returns a list of prioritized XML-tags.
 
bool readTopologyOnly (const std::string &fileName)
 Reads patch topology from the specified input file. More...
 
int getUniquePropertyCode (const std::string &setName, int comp=0)
 Returns a unique integer code for a Property set. More...
 
size_t setVecProperty (int code, Property::Type ptype, VecFunc *field=nullptr, int pflag=-1)
 Defines a vector field property. More...
 
bool setTracProperty (int code, Property::Type ptype, TractionFunc *field=nullptr)
 Defines a traction field property. More...
 
size_t setPropertyType (int code, Property::Type ptype, int pindex=-1, char basis=1)
 Defines the type of a property set. More...
 
bool setNeumann (const std::string &prop, const std::string &type, int ndir, int code)
 Defines a Neumann boundary condition property by parsing a string. More...
 
std::vector< int > getFunctionsForElements (const std::vector< int > &elements)
 Finds the set of basis functions with support on a set of elements. More...
 
bool refine (const LR::RefineData &prm)
 Refines the mesh adaptively. More...
 
bool refine (const LR::RefineData &prm, Vector &sol)
 Refines the mesh adaptively. More...
 
bool refine (const LR::RefineData &prm, Vectors &sol)
 Refines the mesh adaptively. More...
 
int refine (const RealFunc &refC, double refTol)
 Refines the mesh based on a mesh density function. More...
 
bool readPatches (std::istream &isp, const char *whiteSpace="")
 Reads patches from given input stream. More...
 
bool addConnection (int mst, int slv, int mIdx, int sIdx, bool coordCheck=false, int dim=1, int thick=1)
 Connects two patches. More...
 
const std::vector< ASM::Interface > & getInterfaces () const
 Obtain a const reference to model topology.
 
int restartBasis (const std::string &restartFile, int restartStep)
 Handles application restarts by reading a serialized basis. More...
 
virtual void clonePatches (const PatchVec &, const std::map< int, int > &)
 Creates the computational FEM model by copying the given patches.
 
virtual bool hasIC (const std::string &name) const
 Checks whether a named initial condition is present.
 
bool setInitialConditions (SIMdependency *fieldHolder=nullptr)
 Sets the initial conditions. More...
 
virtual bool deSerialize (const SerializeMap &)
 Deserialization support (for simulation restart).
 
const TopEntitygetEntity (const std::string &name) const
 Returns reference to a named topology entity.
 
TopEntitytopology (const std::string &name)
 Returns access to a named topology entity (for model generators).
 
const TopologySetgetTopology () const
 Returns the whole topology set container (for testing only).
 
bool getTopItemNodes (const TopItem &titem, std::vector< int > &glbNodes) const
 Returns the node numbers associated with a topological item.
 
IdxVec3getDiscretePoint (int idx)
 Returns pointer to an indexed discrete point.
 
- Public Member Functions inherited from SIMbase
virtual ~SIMbase ()
 The destructor frees the dynamically allocated objects.
 
bool readModel (const char *fileName)
 Reads model data from the specified input file *fileName. More...
 
virtual void initForSingleStep ()
 Interface for app-specific single-step simulation initialisation.
 
virtual void initForMultiStep ()
 Interface for app-specific multi-step simulation initialisation.
 
virtual bool preprocessC (const IntVec &ignored, bool fixDup, double time0)
 Performs some pre-processing tasks on the FE model. More...
 
bool initSystem (LinAlg::MatrixType mType, size_t nMats=1, size_t nVec=1, size_t nScl=0, bool withRF=false)
 Allocates the system matrices of the FE problem to be solved. More...
 
bool initSystem (const SIMbase *that)
 Lets this simulator share equation system with that simulator.
 
void initLHSbuffers ()
 Initializes left-hand-side element matrix buffers for integrand.
 
bool setAssociatedRHS (size_t iMat, size_t iVec)
 Associates a system vector to a system matrix. More...
 
bool setMode (int mode, bool needIntegr=true, bool resetSol=false)
 Defines the solution mode before the element assembly is started. More...
 
void setIntegrationPrm (unsigned short int i, double prm)
 Initializes an integration parameter for the integrand. More...
 
void setQuadratureRule (size_t ng, bool redimBuffers=false, bool printQP=false)
 Defines the spatial numerical integration scheme to use. More...
 
virtual bool printProblem () const
 Prints out problem-specific data to the log stream.
 
const IntegrandBasegetProblem () const
 Returns a pointer to the problem-specific data object.
 
virtual ASM::InterfaceCheckergetInterfaceChecker (size_t) const
 Returns interface checker type for model.
 
void clearProblem ()
 Clears the reference to the problem-specific data object. More...
 
virtual bool mixedProblem () const
 Returns whether a mixed formulation is used (used by HDF5 output).
 
const LinSolParamsgetSolParams () const
 Returns the linear equation solver parameters (for PETSc).
 
virtual size_t getNoSpaceDim () const
 Returns the number of spatial dimensions in the model.
 
size_t getNoFields (int basis=0) const
 Returns the number of primary solution fields. More...
 
size_t getNoDOFs (bool subSim=false) const
 Returns the model size in terms of number of DOFs.
 
size_t getNoNodes (int basis=0) const
 Returns the model size in terms of number of unique nodes. More...
 
size_t getNoElms (bool includeXelms=false, bool includeZelms=false) const
 Returns the model size in terms of number of elements. More...
 
size_t getNoSolutions (bool allocated=false) const
 Returns the number of solution vectors.
 
int getNoPatches () const
 Returns the total number of patches in the model.
 
size_t getNoEquations () const
 Returns the number of unknowns in the linear equation system.
 
size_t getNoConstraints () const
 Returns the number of constraint equations in the model.
 
virtual size_t getNoRHS () const
 Returns the number of right-hand-side vectors.
 
unsigned char getNoBasis () const
 Returns the number of bases in the model.
 
char getNodeType (int inod) const
 Returns the type (DOF classification) of the specified global node.
 
Vec4 getNodeCoord (int inod) const
 Returns the spatial coordinates of the specified global node.
 
bool isFixed (int inod, int dof=123) const
 Returns true if all DOFs in the specified global node are fixed.
 
int getGlobalNode (int node) const
 Returns the global node number from a process-local node number.
 
int getLocalNode (int node) const
 Returns the process-local node number from a global node number.
 
bool getElmNodes (IntVec &mnpc, int iel) const
 Finds the Matrix of Nodal Point Correspondance for element iel.
 
void getBoundaryNodes (int pcode, IntVec &glbNodes, std::vector< Vec3 > *XYZ=nullptr) const
 Finds the list of global nodes associated with a boundary. More...
 
int findClosestNode (const Vec3 &) const
 Finds the node that is closest to the given point X.
 
IntVec getNodeSet (const std::string &setName) const
 Returns a predefined node set. More...
 
bool initDirichlet (double time=0.0)
 Initializes time-dependent in-homogeneous Dirichlet coefficients. More...
 
bool hasTimeDependentDirichlet () const
 Checks for time-dependent in-homogeneous Dirichlet conditions.
 
virtual bool updateDirichlet (double time=0.0, const Vector *prevSol=nullptr)
 Updates the time-dependent in-homogeneous Dirichlet coefficients. More...
 
virtual bool updateConfiguration (const Vector &)
 Updates problem-dependent state based on the current solution.
 
virtual bool updateRotations (const RealArray &, double=0.0)
 Updates the nodal rotations for problems with rotational DOFs.
 
bool updateGrid (const RealArray &displ)
 Updates the grid coordinates. More...
 
bool updateGrid (const std::string &field)
 Updates the grid coordinates. More...
 
void setRefined (int nref)
 Sets the refinement status (for restart of adaptive simulations). More...
 
int getRefined () const
 Returns current refinement status.
 
bool hasElementActivator () const
 Returns true if an element activation function is specified.
 
void updateForNewElements (Vector &solution, const TimeDomain &time) const
 Modifies the current solution vector when activating elements. More...
 
virtual bool assembleSystem (const TimeDomain &time, const Vectors &prevSol, bool newLHSmatrix=true, bool poorConvg=false)
 Administers assembly of the linear equation system. More...
 
bool assembleSystem (double t0=0.0, const Vectors &pSol=Vectors())
 Administers assembly of the linear equation system. More...
 
bool extractLoadVec (Vector &loadVec, size_t idx=0, const char *hd=nullptr) const
 Extracts the assembled load vector for inspection/visualization. More...
 
bool extractScalars (RealArray &values) const
 Extracts the assembled global scalar quantities.
 
double extractScalar (size_t idx=0) const
 Extracts an assembled global scalar quantity.
 
bool applyDirichlet (Vector &glbVec) const
 Applies the Dirichlet conditions to given vector. More...
 
bool solveEqSystem (Vector &solution, size_t idxRHS, double *rCond, int printSol=0, bool dumpEqSys=false, const char *compName="displacement")
 Solves the assembled linear system of equations for a given load. More...
 
virtual bool solveSystem (Vector &solution, int printSol, double *rCond, const char *compName="displacement", size_t idxRHS=0)
 Solves the assembled linear system of equations for a given load. More...
 
bool solveSystem (Vector &solution, int printSol=0, const char *compName="displacement")
 Solves the assembled linear system of equations for a given load. More...
 
bool solveSystem (Vectors &solution, int printSol=0, const char *cmpName="displacement")
 Solves a linear system of equations with multiple right-hand-sides. More...
 
void getWorstDofs (const Vector &x, const Vector &r, size_t nWorst, double eps, int iteNorm, std::map< std::pair< int, int >, RealArray > &worst) const
 Finds the DOFs showing the worst convergence behavior. More...
 
virtual void iterationNorms (const Vector &x, const Vector &r, double &eNorm, double &rNorm, double &dNorm) const
 Evaluates some iteration norms for convergence assessment. More...
 
double solutionNorms (const Vector &x, double *inf=nullptr, size_t *ind=nullptr, size_t nf=0, char type='D') const
 Evaluates some norms of the primary solution vector. More...
 
bool solutionNorms (const TimeDomain &time, const Vectors &psol, const Vectors &ssol, Vectors &gNorm, Matrix *eNorm=nullptr, const char *name=nullptr)
 Integrates some solution norm quantities. More...
 
bool solutionNorms (const TimeDomain &time, const Vectors &psol, Vectors &gNorm, Matrix *eNorm=nullptr)
 Integrates some solution norm quantities. More...
 
bool solutionNorms (const Vector &psol, const Vectors &ssol, Matrix &eNorm, Vectors &gNorm, const char *name=nullptr)
 Integrates some solution norm quantities. More...
 
bool solutionNorms (const Vector &psol, Matrix &eNorm, Vectors &gNorm)
 Integrates some solution norm quantities. More...
 
bool solutionNorms (const Vector &psol, const Vectors &ssol, Vectors &gNorm, const char *name=nullptr)
 Integrates some solution norm quantities. More...
 
virtual void printStep (int istep, const TimeDomain &time) const
 Prints out load/time step identification. More...
 
virtual void printSolutionSummary (const Vector &solution, int printSol=0, const char *compName=nullptr, std::streamsize outPrec=0)
 Prints a summary of the calculated solution to std::cout. More...
 
bool getCurrentReactions (RealArray &RF, const Vector &psol, int pcode=0) const
 Computes the total reaction forces in the model. More...
 
bool haveReactions (int pcode=0) const
 Checks for total reaction forces associated with a boundary. More...
 
virtual const RealArraygetReactionForces () const
 Returns current reaction force container.
 
bool systemModes (std::vector< Mode > &solution, int nev, int ncv, int iop, double shift, size_t iA=0, size_t iB=1)
 Performs a generalized eigenvalue analysis of the assembled system. More...
 
bool systemModes (std::vector< Mode > &solution, size_t iA=0, size_t iB=1)
 Performs a generalized eigenvalue analysis of the assembled system. More...
 
virtual bool haveBoundaryReactions (bool=false) const
 Returns whether reaction forces are to be computed or not.
 
bool assembleForces (const Vector &solution, double t0, RealArray *R, Vector *S=nullptr)
 Assembles reaction and interface forces for specified boundaries. More...
 
virtual bool project (Matrix &ssol, const Vector &psol, SIMoptions::ProjectionMethod method=SIMoptions::GLOBAL, const TimeDomain &time=TimeDomain()) const
 Projects the secondary solution associated with a primary solution. More...
 
bool project (Vector &ssol, const Vector &psol, SIMoptions::ProjectionMethod method=SIMoptions::GLOBAL, size_t iComp=0) const
 Projects the secondary solution associated with a primary solution. More...
 
bool projectAnaSol (Vector &ssol, SIMoptions::ProjectionMethod method) const
 Projects the analytical secondary solution, if any. More...
 
bool project (RealArray &values, const FunctionBase *f, int basis=1, int iField=0, int nFields=1, SIMoptions::ProjectionMethod method=SIMoptions::GLOBAL, double time=0.0) const
 Projects a function onto the specified basis. More...
 
bool evalSecondarySolution (Matrix &field, int pindx) const
 Evaluates the secondary solution field for specified patch. More...
 
virtual bool fieldProjections () const
 Returns whether projections must be handled through fields or not.
 
virtual bool haveAnaSol () const
 Returns whether an analytical solution is available or not.
 
virtual bool haveDualSol () const
 Returns whether a dual solution is available or not.
 
NormBasegetNormIntegrand () const
 Returns a pointer to a norm integrand object for this simulator. More...
 
ForceBasegetBoundaryForceIntegrand (const Vec3 *X0=nullptr) const
 Returns a pointer to a force integrand object for this simulator. More...
 
ForceBasegetNodalForceIntegrand () const
 Returns a pointer to a force integrand object for this simulator. More...
 
const SAMgetSAM () const
 Returns a const pointer to the SAM object of this simulator.
 
void registerDependency (const std::string &name, SIMdependency *sim, short int nvc=1, unsigned char basis=1)
 Registers a dependency on a field from another SIM object. More...
 
bool extractPatchSolution (const Vectors &sol, size_t pindx) const
 Extracts all local solution vector(s) for a specified patch. More...
 
size_t extractPatchSolution (const RealArray &sol, RealArray &vec, const ASMbase *pch, unsigned char nndof=0, unsigned char basis=0) const
 Extracts a local solution vector for a specified patch. More...
 
bool injectPatchSolution (RealArray &sol, const RealArray &vec, const ASMbase *pch, unsigned char nndof=0, unsigned char basis=0) const
 Injects a patch-wise solution vector into the global vector. More...
 
bool extractPatchElmRes (const Matrix &glbRes, Matrix &elRes, int pindx) const
 Extracts element results for a specified patch. More...
 
int getLocalPatchIndex (int patchNo) const
 Returns the local patch index for the given global patch number. More...
 
const PatchVecgetFEModel () const
 Returns a const reference to our FEM model.
 
ASMbasegetPatch (int idx, bool glbIndex=false) const
 Returns a pointer to a specified patch of our FEM model. More...
 
bool setPatchMaterial (size_t patch) const
 Initializes material properties for the given patch.
 
const std::map< int, int > & getGlob2LocMap () const
 Returns a const reference to our global-to-local node mapping.
 
PropertyVec::const_iterator begin_prop () const
 Returns the beginning of the property array.
 
PropertyVec::const_iterator end_prop () const
 Returns the end of the property array.
 
SystemMatrixgetRayleighDampingMatrix (size_t iM=1, size_t iK=0) const
 Returns current Rayleigh system damping matrix. More...
 
SystemMatrixgetLHSmatrix (size_t idx=0, bool copy=false) const
 Returns current system left-hand-side matrix.
 
SystemVectorgetRHSvector (size_t idx=0, bool copy=false) const
 Returns current system right-hand-side vector.
 
void addToRHSvector (size_t idx, const SystemVector &vec, double scale=1.0)
 Adds a system vector to the given right-hand-side vector.
 
RealFuncgetSclFunc (int code) const
 Returns a scalar function associated with code.
 
void setMDflag (char flag)
 Sets the multi-dimension simulator sequence flag.
 
bool isFirst () const
 Returns true, if this is the equation system owner.
 
void dumpEqSys (bool initialBlankLine=false)
 Dumps left-hand-side matrix and right-hand-side vector to file.
 
void dumpSolVec (const Vector &x, bool isExpanded=true, bool expOnly=false)
 Dumps a solution vector to file.
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, char diffBasis=0, int component=1)
 Registers a dependency on a field from another SIM object. More...
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, const int *MADOF)
 Registers a dependency on a field from another SIM object. More...
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc=1)
 Registers a dependency on a field from another SIM object. 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 ProcessAdmgetProcessAdm () 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 SIMdependency
virtual ~SIMdependency ()
 Empty destructor.
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, char diffBasis=0, int component=1)
 Registers a dependency on a field from another SIM object. More...
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, const int *MADOF)
 Registers a dependency on a field from another SIM object. More...
 
virtual void registerDependency (SIMdependency *sim, const std::string &name, short int nvc=1)
 Registers a dependency on a field from another SIM object. More...
 
bool fillField (const std::string &name, const std::vector< double > &values)
 Initializes the nodal vector of named field in this SIM.
 
virtual std::vector< double > * getField (const std::string &name)
 Returns the nodal vector of named field in this SIM.
 
virtual const std::vector< double > * getField (const std::string &name) const
 Returns the nodal vector of named field in this SIM.
 
const std::vector< double > * getDependentField (const std::string &name) const
 Returns the nodal vector of named field in a dependent SIM.
 
ASMbasegetDependentPatch (const std::string &name, int pindx) const
 Returns a spline patch associated with a dependent field.
 
void registerField (const std::string &name, const std::vector< double > &vec)
 Registers a named field with associated nodal vector in this SIM.
 

Protected Member Functions

virtual bool parse (const tinyxml2::XMLElement *elem)
 Parses a data section from an XML element. More...
 
virtual ASMbasereadPatch (std::istream &isp, int pchInd, const CharVec &, const char *whiteSpace) const
 Reads a patch from given input stream. More...
 
virtual bool recoverInternalDOFs (const ASMbase *, SuperElm &sup, const Vector &supSol) const
 Recovers the internal DOFs from static condensation. More...
 
- Protected Member Functions inherited from SIMdummy< SIMgeneric >
 SIMdummy (IntegrandBase *p=nullptr)
 Default constructor.
 
virtual ~SIMdummy ()
 Empty destructor.
 
virtual bool parseGeometryDimTag (const tinyxml2::XMLElement *)
 Parses a dimension-specific subelement of the geometry XML-tag.
 
virtual void preprocessResultPoints ()
 Preprocesses the result sampling points.
 
virtual ModelGeneratorgetModelGenerator (const tinyxml2::XMLElement *) const
 Creates a model generator.
 
virtual bool connectPatches (const ASM::Interface &, bool)
 Connects two patches.
 
- Protected Member Functions inherited from SIMgeneric
 SIMgeneric (IntegrandBase *itg=nullptr)
 Default constructor.
 
bool revertSqrt (Vectors &gNorm, Matrix *eNorm)
 Reverts the square-root operation on some norm quantities. More...
 
- Protected Member Functions inherited from SIMoutput
 SIMoutput (IntegrandBase *itg)
 The constructor just forwards to the base class constructor.
 
virtual bool parseOutputTag (const tinyxml2::XMLElement *elem)
 Parses a subelement of the resultoutput XML-tag.
 
virtual ElementBlocktesselatePatch (size_t pidx) const
 Tesselates the specified patch.
 
void addAddFunc (const std::string &fn, RealFunc *f)
 Adds a function for additional VTF-file output. More...
 
virtual bool writeAddFuncs (int &nBlock, int &idBlock, const Vector &psol, int iStep, double time)
 Writes out the additional functions to VTF-file. More...
 
- Protected Member Functions inherited from SIMinput
 SIMinput (IntegrandBase *itg)
 The constructor just forwards to the base class constructor.
 
bool parsePeriodic (const tinyxml2::XMLElement *elem)
 Parses the periodic XML-tag. More...
 
FunctionBaseparseDualTag (const tinyxml2::XMLElement *elem, int ftype=1)
 Parses the dualfield tag.
 
int parseMaterialSet (const tinyxml2::XMLElement *elem, int mindex)
 Parses the "set" attribute of a material XML-tag. More...
 
bool parseTopologySet (const tinyxml2::XMLElement *elem, std::vector< int > &patches) const
 Parses the "set" attribute of a refine/raiseorder XML-tag. More...
 
bool parsePatchList (const tinyxml2::XMLElement *elem, std::vector< int > &patches) const
 Parses a list of patch indices from an XML-tag. More...
 
bool createPropertySet (const std::string &setName, int pc)
 Creates a set of Property objects. More...
 
virtual bool readNodes (std::istream &isn, int pchInd, int basis=0, bool oneBased=false)
 Reads global node data for a patch from given input stream. More...
 
virtual void readNodes (std::istream &isn)
 Reads node numbers from given input stream. More...
 
bool saveBasis (SerializeMap &data) const
 Writes current basis to a serialization container. More...
 
bool restoreBasis (const SerializeMap &data)
 Restores the basis from a serialization container. More...
 
- Protected Member Functions inherited from SIMbase
 SIMbase (IntegrandBase *itg)
 The constructor initializes the pointers to dynamic data members.
 
VecFuncgetVecFunc (size_t patch, Property::Type ptype) const
 Returns a vector function associated with given patch and property. More...
 
virtual bool addConstraint (int patch, int lndx, int ldim, int dirs, int code, int &ngnod, char basis=1, bool ovrD=false)
 Preprocesses a user-defined Dirichlet boundary property. More...
 
virtual void preprocessA ()
 Preprocessing performed before the FEM model generation.
 
virtual bool preprocessBeforeAsmInit (int &)
 Specialized preprocessing performed before assembly initialization.
 
virtual bool preprocessB ()
 Preprocessing performed after the system assembly initialization.
 
int renumberNodes (bool renumMNPC=false)
 Renumbers the global node numbers after resolving patch topology. More...
 
virtual bool renumberNodes (const std::map< int, int > &)
 Interface for renumbering of app-specific node number tables.
 
virtual bool extractPatchSolution (IntegrandBase *problem, const Vectors &sol, size_t pindx) const
 Extracts all local solution vector(s) for a specified patch. More...
 
char getMDflag () const
 Returns the multi-dimension simulator sequence flag.
 
virtual void shiftGlobalNums (int, int)
 Shifts global node and element numbers by constant offsets.
 
virtual bool initMaterial (size_t)
 Initializes material properties for integration of interior terms.
 
virtual bool initBodyLoad (size_t)
 Initializes the body load properties for current patch.
 
virtual bool initNeumann (size_t)
 Initializes for integration of Neumann terms for a given property.
 
virtual bool assembleDiscreteTerms (const IntegrandBase *, const TimeDomain &)
 Assembles problem-dependent discrete terms, if any.
 
virtual bool assembleDiscreteItems (const IntegrandBase *itg, const TimeDomain &time, const Vectors &)
 Assembles problem-dependent discrete terms, if any. More...
 
virtual double externalEnergy (const Vectors &psol, const TimeDomain &) const
 Computes (possibly problem-dependent) external energy contribution.
 
virtual bool postProcessNorms (Vectors &, Matrix *)
 Applies app-specific post-processing on norms.
 
void generateThreadGroups (const Property &p, bool silence=false)
 Generates element groups for multi-threading of boundary integrals. More...
 
void changeNumThreads ()
 Called if number of threads changes.
 
bool addMADOF (unsigned char basis, unsigned char nndof, bool other=true)
 Adds a MADOF with an extraordinary number of DOFs on a given basis. More...
 
double * theExtEnerg ()
 Returns a pointer to the external energy path integral value.
 
const double * getExtEnerg () const
 Returns a const pointer to the external energy path integral value.
 
- 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...
 
- Protected Member Functions inherited from SIMdependency
 SIMdependency ()
 The constructor is protected to allow sub-class instances only.
 
bool extractPatchDependencies (IntegrandBase *problem, const PatchVec &model, size_t pindx) const
 Extracts local solution vector(s) for all dependent fields. More...
 

Protected Attributes

std::vector< SuperElmmySups
 Superelement data container.
 
- Protected Attributes inherited from SIMoutput
std::map< int, int > addDisBlk
 Additional displacement block mapping.
 
std::vector< ResPtPairmyPoints
 User-defined result sampling points.
 
- Protected Attributes inherited from SIMinput
ModelGeneratormyGen
 Model generator.
 
TopologySet myEntitys
 Set of named topological entities.
 
std::vector< IdxVec3myTopPts
 Discrete points not belonging to any patch.
 
std::vector< ASM::InterfacemyInterfaces
 Topology interface descriptions.
 
std::map< std::string, InitialCondVecmyICs
 Initial condition definitions.
 
- Protected Attributes inherited from SIMbase
unsigned char nsd
 Number of spatial dimensions.
 
PatchVec myModel
 The actual NURBS/spline model.
 
PropertyVec myProps
 Physical property mapping.
 
SclFuncMap myScalars
 Scalar property fields.
 
VecFuncMap myVectors
 Vector property fields.
 
TracFuncMap myTracs
 Traction property fields.
 
IntegrandBasemyProblem
 The main integrand of this simulator.
 
IntegrandMap myInts
 Set of all integrands involved.
 
AnaSolmySol
 Analytical/Exact solution.
 
FunctionBasedualField
 Dual solution field (extraction function)
 
std::vector< FunctionBase * > extrFunc
 Extraction functions for VCP.
 
int nGlbNodes
 Total number of unique nodes in the model. More...
 
int isRefined
 Indicates if the model is adaptively refined.
 
bool lagMTOK
 Indicates if global multipliers is OK with multithreading.
 
bool fixZeros
 If true, constrain zero pivots before solving.
 
std::vector< DumpDatalhsDump
 Coefficient matrix dump specifications.
 
std::vector< DumpDatarhsDump
 Right-hand-side vector dump specifications.
 
std::vector< DumpDatasolDump
 Solution vector dump specifications.
 
int nGlPatches
 Number of global patches.
 
IntVec myPatches
 Global patch numbers for current processor.
 
IntVec myLoc2Glb
 Local-to-global node number mapping.
 
std::map< int, int > myGlb2Loc
 Global-to-local node number mapping.
 
const std::map< int, int > * g2l
 Pointer to global-to-local node mapping.
 
std::map< int, int > myDegenElm
 Degenerated elements mapping.
 
std::set< int > myDupNodes
 Set of duplicated nodes.
 
AlgEqSystemmyEqSys
 The actual linear equation system.
 
SAMmySam
 Auxiliary data for FE assembly management.
 
LinSolParamsmySolParams
 Input parameters for PETSc.
 
LinSolParamsmyGl2Params
 Input parameters for PETSc, for L2 projection.
 
- 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.
 

Private Attributes

unsigned char ncmp
 Number of primary solution components per node.
 

Additional Inherited Members

- Public Types inherited from SIMinput
typedef std::vector< ICInfoInitialCondVec
 Convenience declaration.
 
typedef std::vector< unsigned char > CharVec
 Convenience declaration.
 
typedef std::pair< int, Vec3IdxVec3
 Convenience declaration.
 
- Public Types inherited from SIMdependency
typedef std::vector< ASMbase * > PatchVec
 Spline patch container.
 
- Public Attributes inherited from SIMadmin
SIMoptionsopt
 Simulation control parameters.
 
- Static Public Attributes inherited from SIMbase
static bool ignoreDirichlet = false
 Set to true for free vibration analysis.
 
static bool preserveNOrder = false
 Set to true to preserve node ordering.
 
- Static Public Attributes inherited from SIMadmin
static int msgLevel = 2
 Controls the console output amount during solving.
 
- Protected Types inherited from SIMoutput
using ResPointVec = std::vector< ResultPoint >
 Result point container.
 
using ResPtPair = std::pair< std::string, ResPointVec >
 File name to result point group mapping.
 
- Protected Types inherited from SIMinput
typedef std::map< std::string, std::string > SerializeMap
 Convenience type.
 
- Protected Types inherited from SIMbase
typedef std::map< int, RealFunc * > SclFuncMap
 Scalar field container.
 
typedef std::map< int, VecFunc * > VecFuncMap
 Vector field container.
 
typedef std::map< int, TractionFunc * > TracFuncMap
 Traction field container.
 
typedef std::multimap< int, IntegrandBase * > IntegrandMap
 Property code to integrand map.
 
- Protected Types inherited from SIMadmin
using IntVec = std::vector< int >
 Convenience alias.
 
- Static Protected Member Functions inherited from SIMinput
static std::istream * getPatchStream (const char *tag, const char *patch)
 Helper method returning a stream for patch geometry input. More...
 

Detailed Description

Solution driver for general superelement FEM analysis.

This class contains methods for setting up a FE analysis of a model consisting of superelements resulting from static condensation or reduced order modeling.

Constructor & Destructor Documentation

◆ SIMsupel()

SIMsupel::SIMsupel ( const char *  hd = nullptr,
char  nf = 6 
)
explicit

Default constructor.

Parameters
[in]hdSub-simulator heading
[in]nfDimension of the primary solution field

References SIMadmin::myHeading, and SIMbase::myProblem.

Member Function Documentation

◆ parse()

bool SIMsupel::parse ( const tinyxml2::XMLElement *  elem)
protectedvirtual

Parses a data section from an XML element.

Parameters
[in]elemThe XML element to parse

Reimplemented from SIMinput.

References IFEM::cout, utl::matrixBase< T >::empty(), utl::getAttribute(), SIMsupel::SuperElm::id, SIMsupel::SuperElm::MVP, SIMinput::myEntitys, SIMbase::myModel, mySups, SIMoutput::parse(), and utl::matrix< T >::resize().

◆ readPatch()

ASMbase * SIMsupel::readPatch ( std::istream &  isp,
int  pchInd,
const CharVec ,
const char *  whiteSpace 
) const
protectedvirtual

Reads a patch from given input stream.

Parameters
[in]ispThe input stream to read from
[in]pchInd0-based index of the patch to read
[in]whiteSpaceFor message formatting

Reimplemented from SIMdummy< SIMgeneric >.

References IFEM::cout, ASM3D::create(), ASMbase::idx, SIMbase::myModel, ncmp, and ASMbase::read().

◆ recoverInternalDOFs() [1/2]

bool SIMsupel::recoverInternalDOFs ( const ASMbase ,
SuperElm sup,
const Vector supSol 
) const
protectedvirtual

Recovers the internal DOFs from static condensation.

Parameters
supThe superelement to recover internal DOFs for
[in]supSolSupernode solution values

References SIMgeneric::recoverInternals(), SIMsupel::SuperElm::sim, and SIMsupel::SuperElm::sol.

◆ recoverInternalDOFs() [2/2]

bool SIMsupel::recoverInternalDOFs ( const Vector glbSol)

Performs recovery of the internal DOFs for superelements.

Parameters
[in]glbSolGlobal solution vector

References utl::vector< T >::empty(), SAM::getMADOF(), SIMbase::myModel, SIMbase::mySam, mySups, and utl::transform().


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