IFEM  90A354
Classes | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SIMbase Class Referenceabstract

Base class for NURBS-based FEM simulators. More...

#include <SIMbase.h>

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

Classes

struct  DumpData
 A struct with data for system matrix/vector dumps. More...
 

Public Member Functions

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 bool createFEMmodel (char resetNumb)=0
 Creates the computational FEM model from the spline patches.
 
virtual void clearProperties ()
 Initializes the property containers of the model. 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...
 
virtual bool merge (SIMbase *that, const std::map< int, int > *old2new=nullptr, int poff=0)
 Merges the global equation system of that simulator with this. 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 std::string getName () const
 Returns the name of this simulator. 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 unsigned short int getNoParamDim () const =0
 Returns the number of parameter dimensions in the model.
 
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.
 
virtual std::vector< IntVecgetElmConnectivities () const =0
 Obtain element-element connectivities.
 
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 int printNRforces (const IntVec &={}) const
 Prints out nodal reaction forces to the log stream.
 
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 parse (char *keyWord, std::istream &is)
 Parses a data section from an input stream.
 
virtual bool parse (const tinyxml2::XMLElement *elem)
 Parses a data section from an XML document.
 
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.
 
virtual bool hasIC (const std::string &) const
 Checks whether a named initial condition is present.
 

Static Public Attributes

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

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.
 

Protected Member Functions

 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.
 
virtual void preprocessResultPoints ()=0
 Preprocesses the result sampling points.
 
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...
 
virtual const char ** getPrioritizedTags () const
 Returns a list of prioritized XML-tags.
 
- 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

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 Member Functions

const IntVecgetMADOF (unsigned char basis, unsigned char nndof) const
 Returns an extraordinary MADOF array. More...
 

Private Attributes

size_t nIntGP
 Number of interior integration points in the whole model.
 
size_t nBouGP
 Number of boundary integration points in the whole model.
 
size_t nDofS
 Number of degrees of freedom in this sub-simulator.
 
char mdFlag
 Sequence flag for multi-dimensional simulators.
 
std::map< int, IntVecextraMADOFs
 Additional MADOF arrays with varying DOF counts per node.
 
double extEnergy
 Path integral of external forces.
 
Vector prevForces
 Reaction forces of previous time step.
 

Additional Inherited Members

- Public Types inherited from SIMdependency
typedef std::vector< ASMbase * > PatchVec
 Spline patch container.
 
- Public Attributes inherited from SIMadmin
SIMoptionsopt
 Simulation control parameters.
 

Detailed Description

Base class for NURBS-based FEM simulators.

This class incapsulates data and methods need for solving partial differential equations using NURBS-based finite elements. It only contains the problem-independent data and methods. Sub-classes are derived with additional info regarding the problem to solve.

Member Function Documentation

◆ addConstraint()

bool SIMbase::addConstraint ( int  patch,
int  lndx,
int  ldim,
int  dirs,
int  code,
int &  ngnod,
char  basis = 1,
bool  ovrD = false 
)
protectedvirtual

Preprocesses a user-defined Dirichlet boundary property.

Parameters
[in]patch1-based index of the patch to receive the property
[in]lndxLocal index of the boundary item to receive the property
[in]ldimDimension of the boundary item to receive the property
[in]dirsWhich local DOFs to constrain
[in]codeIn-homogeneous Dirichlet condition property code
ngnodTotal number of global nodes in the model (might be updated)
[in]basisWhich basis to apply the constraint to (mixed methods)
[in]ovrDIf true, override conflicting Dirichlet conditions

This method only deals with constraints assigned directly to some (or all) FE nodes of the specified patch. The method needs to be overridden by the dimension-specific sub-classes to handle constraints on other topological entities, such as boundary edges and faces.

Reimplemented in SIM1D, SIM3D, and SIM2D.

References IFEM::cout, getNodeSet(), getNoParamDim(), and myModel.

Referenced by SIM2D::addConstraint(), SIM3D::addConstraint(), SIM1D::addConstraint(), and preprocessC().

◆ addMADOF()

bool SIMbase::addMADOF ( unsigned char  basis,
unsigned char  nndof,
bool  other = true 
)
protected

Adds a MADOF with an extraordinary number of DOFs on a given basis.

Parameters
[in]basisThe basis to specify number of DOFs for
[in]nndofNumber of nodal DOFs on the given basis
[in]otherIf true, include other bases in MADOF as well

References extraMADOFs, getNoNodes(), and myModel.

◆ applyDirichlet()

bool SIMbase::applyDirichlet ( Vector glbVec) const

Applies the Dirichlet conditions to given vector.

Parameters
[out]glbVecGlobal vector in DOF-order

References SAM::applyDirichlet(), and mySam.

◆ assembleDiscreteItems()

virtual bool SIMbase::assembleDiscreteItems ( const IntegrandBase itg,
const TimeDomain time,
const Vectors  
)
inlineprotectedvirtual

Assembles problem-dependent discrete terms, if any.

Override this method if the discrete terms also depend on current solution state. By default it forwards to the state-less method assembleDiscreteTerms() which can be overridden if no state-dependency.

References assembleDiscreteTerms().

Referenced by assembleSystem().

◆ assembleForces()

bool SIMbase::assembleForces ( const Vector solution,
double  t0,
RealArray R,
Vector S = nullptr 
)

Assembles reaction and interface forces for specified boundaries.

Parameters
[in]solutionCurrent primary solution vector
[in]t0Current time (for time-dependent loads)
[out]RNodal reaction force container
[out]SNodal interface force container

References SIMadmin::adm, assembleSystem(), myEqSys, myProblem, mySam, setMode(), and IntegrandBase::setSecondaryInt().

◆ assembleSystem() [1/2]

bool SIMbase::assembleSystem ( const TimeDomain time,
const Vectors prevSol,
bool  newLHSmatrix = true,
bool  poorConvg = false 
)
virtual

Administers assembly of the linear equation system.

Parameters
[in]timeParameters for nonlinear/time-dependent simulations
[in]prevSolPrevious primary solution vectors in DOF-order
[in]newLHSmatrixIf false, only integrate the RHS vector
[in]poorConvgIf true, the nonlinear driver is converging poorly

This method constitutes the main core of the element assembly process, to establish the global linear system of equations to be solved at each time/load step (or iteration if nonlinear problem).

The method loops over all the Integrand objects defining the problem to be solved, and for each Integrand it loops over the ASMbase patches defining the FE model for doing the numerical integration. It also has separate loops for handling the boundary integrals (for Neumann and Robin type boundary conditions).

References assembleDiscreteItems(), utl::vector< T >::clear(), IFEM::cout, dualField, ASMbase::empty(), extractPatchSolution(), AlgEqSystem::finalize(), GlobalIntegral::finalize(), fixZeros, ASMbase::getElementSet(), IntegrandBase::getExtractionField(), getInterfaceChecker(), IntegrandBase::getMode(), ASMbase::getNoParamDim(), getPatch(), ASMbase::idx, initBodyLoad(), AlgEqSystem::initialize(), GlobalIntegral::initialize(), initMaterial(), AnaSol::initPatch(), FunctionBase::initPatch(), ASMbase::integrate(), ASMbase::integrateEdge(), Integrand::INTERFACE_TERMS, mdFlag, SIMadmin::msgLevel, myEqSys, myInts, myModel, myProblem, myProps, mySol, and PROFILE1.

Referenced by AdaptiveSIM::assembleAndSolveSystem(), assembleForces(), TimeIntegration::SIMImplicitLMM< Solver >::LMMNonLinSIM::assembleSystem(), NonLinSIM::assembleSystem(), assembleSystem(), NewmarkSIM::initAcc(), EigenModeSIM::initSol(), NewmarkSIM::solveIteration(), and NewmarkSIM::solveStep().

◆ assembleSystem() [2/2]

bool SIMbase::assembleSystem ( double  t0 = 0.0,
const Vectors pSol = Vectors() 
)
inline

Administers assembly of the linear equation system.

Parameters
[in]t0Time for evaluation of time-dependent property functions
[in]pSolPrimary solution vectors in DOF-order

Use this version for linear/stationary problems only.

References assembleSystem().

◆ clearProblem()

void SIMbase::clearProblem ( )
inline

Clears the reference to the problem-specific data object.

This method is used when the same IntegrandBase object is shared by several SIMbase objects, to avoid that it is deleted more than once.

References myProblem.

◆ clearProperties()

void SIMbase::clearProperties ( )
virtual

Initializes the property containers of the model.

Use this method to clear the model before re-reading the input file in the refinement step of an adaptive simulation.

Reimplemented in SIMoutput.

References SIMadmin::adm, DomainDecomposition::clear(), ProcessAdm::dd, dualField, extraMADOFs, extrFunc, myGlb2Loc, myInts, myModel, myPatches, myProps, myScalars, myTracs, myVectors, and nGlbNodes.

Referenced by SIMoutput::clearProperties(), and ~SIMbase().

◆ evalSecondarySolution()

bool SIMbase::evalSecondarySolution ( Matrix field,
int  pindx 
) const

Evaluates the secondary solution field for specified patch.

Parameters
[out]fieldControl point values of the secondary solution field
[in]pindxLocal patch index to evaluate solution field for

The secondary solution is derived from the primary solution, which is assumed to be stored within the Integrand object myProblem. The solution is evaluated at the Greville points and then projected onto the spline basis to obtain the control point values.

References ASMbase::evalSolution(), getPatch(), myProblem, and setPatchMaterial().

Referenced by HDF5Writer::writeSIM().

◆ extractLoadVec()

bool SIMbase::extractLoadVec ( Vector loadVec,
size_t  idx = 0,
const char *  hd = nullptr 
) const

Extracts the assembled load vector for inspection/visualization.

Parameters
[out]loadVecGlobal load vector in DOF-order
[in]idxIndex to the system vector to extract
[in]hdHeader for outprint of resultant

References IFEM::cout, SAM::expandSolution(), SAM::getNodeDOFs(), SAM::getNoNodes(), AlgEqSystem::getVector(), myEqSys, mySam, and SAM::printVector().

Referenced by NonLinSIM::lineSearch(), NewmarkSIM::solveIteration(), NonLinSIM::solveIteration(), and NewmarkSIM::solveStep().

◆ extractPatchElmRes()

bool SIMbase::extractPatchElmRes ( const Matrix glbRes,
Matrix elRes,
int  pindx 
) const

Extracts element results for a specified patch.

Parameters
[in]glbResGlobal element result array
[out]elResPatch-level element result array
[in]pindxLocal patch index to extract element results for

References utl::matrixBase< T >::empty(), ASMbase::extractElmRes(), and getPatch().

Referenced by HDF5Writer::writeKnotspan(), and HDF5Writer::writeSIM().

◆ extractPatchSolution() [1/3]

size_t SIMbase::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.

Parameters
[in]solGlobal primary solution vector in DOF-order
[out]vecLocal solution vector associated with specified patch
[in]pchThe patch to extract solution vector for
[in]nndofNumber of DOFs per node (optional)
[in]basisBasis to extract for (optional)
Returns
Total number of DOFs in the patch (first basis only if mixed)

References ASMbase::empty(), ASMbase::extractNodalVec(), ASMbase::extractNodeVec(), extraMADOFs, SAM::getMADOF(), getMADOF(), ASMbase::getNodeID(), ASMbase::getNodeType(), ASMbase::getNoFields(), SAM::getNoNodes(), ASMbase::getNoNodes(), myModel, and mySam.

◆ extractPatchSolution() [2/3]

bool SIMbase::extractPatchSolution ( const Vectors sol,
size_t  pindx 
) const
inline

Extracts all local solution vector(s) for a specified patch.

Parameters
[in]solGlobal primary solution vectors in DOF-order
[in]pindxLocal patch index to extract solution vectors for

References extractPatchSolution(), and myProblem.

◆ extractPatchSolution() [3/3]

bool SIMbase::extractPatchSolution ( IntegrandBase problem,
const Vectors sol,
size_t  pindx 
) const
protectedvirtual

Extracts all local solution vector(s) for a specified patch.

Parameters
[in]problemThe integrand to receive patch-level solution vectors
[in]solGlobal primary solution vectors in DOF-order
[in]pindxLocal patch index to extract solution vectors for

This method is typically invoked before ASMbase::integrate() on the specified patch, in order to extract all patch-level vector quantities needed by the Integrand. This also includes any dependent vectors from other simulator classes that have been registered. All patch-level vectors are stored within the provided integrand.

References utl::vector< T >::clear(), ASMbase::extractNodalVec(), SIMdependency::extractPatchDependencies(), ASMbase::getGlobalNodeNums(), SAM::getMADOF(), IntegrandBase::getNoSolutions(), getPatch(), IntegrandBase::getSolution(), IntegrandBase::initNodeMap(), myModel, and mySam.

Referenced by assembleSystem(), compute(), extractPatchSolution(), SIM::integrate(), project(), SIMinput::refine(), solutionNorms(), updateGrid(), SIMoutput::writeGlvP(), SIMoutput::writeGlvS(), and HDF5Writer::writeSIM().

◆ generateThreadGroups()

void SIMbase::generateThreadGroups ( const Property p,
bool  silence = false 
)
protected

Generates element groups for multi-threading of boundary integrals.

Parameters
[in]pProperty object identifying a patch boundary
[in]silenceIf true, suppress threading group outprint

References ASMbase::empty(), ASMbase::generateThreadGroups(), ASMbase::getNoParamDim(), getPatch(), lagMTOK, Property::ldim, Property::lindx, and Property::patch.

◆ getBoundaryForceIntegrand()

ForceBase * SIMbase::getBoundaryForceIntegrand ( const Vec3 X0 = nullptr) const

Returns a pointer to a force integrand object for this simulator.

Note
The object is allocated dynamically and has therefore to be manually deleted before the variable receiving the pointer value goes out of scope.

References IntegrandBase::getForceIntegrand(), myProblem, and mySol.

Referenced by SIM::getBoundaryForce().

◆ getBoundaryNodes()

void SIMbase::getBoundaryNodes ( int  pcode,
IntVec glbNodes,
std::vector< Vec3 > *  XYZ = nullptr 
) const

Finds the list of global nodes associated with a boundary.

Parameters
[in]pcodeProperty code identifying the boundary
[out]glbNodesGlobal node numbers on the boundary
[out]XYZSpatial coordinates of the boundary nodes (optional)

References ASMbase::getBoundary1Nodes(), ASMbase::getBoundaryNodes(), ASMbase::getCoord(), ASMbase::getNodeID(), ASMbase::getNodeIndex(), ASMbase::getNodeSet(), ASMbase::getNoNodes(), ASMbase::getNoParamDim(), getPatch(), and myProps.

Referenced by getCurrentReactions(), SIMgeneric::getInterfaceForces(), haveReactions(), and SIM::initBoundaryNodeMap().

◆ getCurrentReactions()

bool SIMbase::getCurrentReactions ( RealArray RF,
const Vector psol,
int  pcode = 0 
) const

Computes the total reaction forces in the model.

Parameters
[out]RFReaction force in each spatial direction + energy
[in]psolPrimary solution vector
[in]pcodeProperty code identifying the boundary for which the reaction forces are computed (0 means the entire model, or all boundaries)

The content of the output array RF is as follows:

\[ RF[0] = \sum_{i=n}^{\rm nnod} \sum_{i=1}^{\rm nsd} f_n^i u_n^i \quad\quad\mbox{(energy)}\]

\[ RF[i] = \sum_{n=1}^{\rm nnod} f_n^i \quad\forall\quad i=1,\ldots,{\rm nsd} \]

If psol representing the displacement field u is empty, the first norm is omitted and the size of the output array RF will be nsd.

References IFEM::cout, utl::vector< T >::empty(), getBoundaryNodes(), SAM::getReaction(), getReactionForces(), mySam, SAM::normReact(), nsd, and printNRforces().

◆ getLocalPatchIndex()

int SIMbase::getLocalPatchIndex ( int  patchNo) const

◆ getMADOF()

const IntVec & SIMbase::getMADOF ( unsigned char  basis,
unsigned char  nndof 
) const
private

Returns an extraordinary MADOF array.

Parameters
[in]basisThe basis to specify number of DOFs for
[in]nndofNumber of nodal DOFs on the given basis

References extraMADOFs.

Referenced by extractPatchSolution(), injectPatchSolution(), registerDependency(), and solutionNorms().

◆ getName()

virtual std::string SIMbase::getName ( ) const
inlinevirtual

Returns the name of this simulator.

This method is typically overridden by sub-classes that are parts of a partitioned solution method and are used to identify the basis for the result fields associated with each simulator in the HDF5 output.

Implements SIMdependency.

Reimplemented in SIMsupel.

Referenced by SIMinput::deSerialize(), HHTSIM::deSerialize(), MultiStepSIM::deSerialize(), NewmarkNLSIM::deSerialize(), initSystem(), preprocessC(), SIMinput::restartBasis(), SIMinput::restoreBasis(), SIMinput::saveBasis(), HHTSIM::serialize(), MultiStepSIM::serialize(), NewmarkNLSIM::serialize(), SIMoutput::serialize(), updateGrid(), HDF5Writer::writeBasis(), HDF5Writer::writeKnotspan(), and HDF5Writer::writeSIM().

◆ getNodalForceIntegrand()

ForceBase * SIMbase::getNodalForceIntegrand ( ) const

Returns a pointer to a force integrand object for this simulator.

Note
The object is allocated dynamically and has therefore to be manually deleted before the variable receiving the pointer value goes out of scope.

References IntegrandBase::getForceIntegrand(), and myProblem.

Referenced by SIM::getNodalForces().

◆ getNodeSet()

IntVec SIMbase::getNodeSet ( const std::string &  setName) const

Returns a predefined node set.

This method extracts the global node numbers of the named set. The sets are defined on the patch level, and in case the set is defined on more than one patch, the union of the patch-wise nodal sets is returned.

References myModel.

Referenced by addConstraint().

◆ getNoElms()

size_t SIMbase::getNoElms ( bool  includeXelms = false,
bool  includeZelms = false 
) const

Returns the model size in terms of number of elements.

Parameters
[in]includeXelmsIf true, include any extra-ordinary elements
[in]includeZelmsIf true, count all regular elements, including zero-volume elements due to multiple knots, etc.

References SAM::getNoElms(), myModel, and mySam.

Referenced by compute(), SIMoutput::dumpMatlabGrid(), SIM::getBoundaryForce(), SIMoutput::getElementSet(), SIMinput::getElmConnectivities(), initLHSbuffers(), initSystem(), and SIMoutput::writeGlvNo().

◆ getNoFields()

size_t SIMbase::getNoFields ( int  basis = 0) const

◆ getNoNodes()

size_t SIMbase::getNoNodes ( int  basis = 0) const

◆ getNormIntegrand()

NormBase * SIMbase::getNormIntegrand ( ) const

Returns a pointer to a norm integrand object for this simulator.

Note
The object is allocated dynamically and has therefore to be manually deleted before the variable receiving the pointer value goes out of scope.

References IntegrandBase::getNormIntegrand(), myProblem, and mySol.

Referenced by AdaptiveSetup::initPrm(), AdaptiveSetup::printNorms(), SIMgeneric::printNorms(), and HDF5Writer::writeSIM().

◆ getPatch()

ASMbase * SIMbase::getPatch ( int  idx,
bool  glbIndex = false 
) const

◆ getRayleighDampingMatrix()

SystemMatrix * SIMbase::getRayleighDampingMatrix ( size_t  iM = 1,
size_t  iK = 0 
) const

Returns current Rayleigh system damping matrix.

Parameters
[in]iMIndex of the system mass matrix
[in]iKIndex of the system stiffness matrix

References SystemMatrix::add(), IntegrandBase::getIntegrationPrm(), getLHSmatrix(), SystemMatrix::mult(), myEqSys, and myProblem.

◆ getVecFunc()

VecFunc * SIMbase::getVecFunc ( size_t  patch,
Property::Type  ptype 
) const
protected

Returns a vector function associated with given patch and property.

Parameters
[in]patch1-based index of the patch to retrieve property for
[in]ptypeThe property type associated with the vector function

References myProps, and myVectors.

◆ getWorstDofs()

void SIMbase::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.

Parameters
[in]xGlobal primary solution vector
[in]rGlobal residual vector associated with the solution vector
[in]nWorstHow many bad DOFs to detect
[in]epsOnly record values larger than this tolerance
[in]iteNormWhich norm to consider (1=res, 2=dis, 3=energy)
[out]worstNode and local DOF number and values of the worst DOFs

References SAM::getNodeAndLocalDof(), mySam, and utl::vector< T >::size().

Referenced by NonLinSIM::printWorst().

◆ haveReactions()

bool SIMbase::haveReactions ( int  pcode = 0) const

Checks for total reaction forces associated with a boundary.

Parameters
[in]pcodeProperty code identifying the boundary (0 = all)

References getBoundaryNodes(), SAM::haveReaction(), mySam, and nsd.

◆ initDirichlet()

bool SIMbase::initDirichlet ( double  time = 0.0)

Initializes time-dependent in-homogeneous Dirichlet coefficients.

Parameters
[in]timeCurrent time

References updateDirichlet().

Referenced by preprocessC().

◆ initSystem()

bool SIMbase::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.

Parameters
[in]mTypeThe matrix format to use
[in]nMatsNumber of system matrices
[in]nVecNumber of system right-hand-side vectors
[in]nSclNumber of global scalar quantities
[in]withRFWhether nodal reaction forces should be computed or not

References SIMadmin::adm, IFEM::cout, LinAlg::DENSE, getName(), getNoElms(), AlgEqSystem::init(), myEqSys, myModel, mySam, mySolParams, SIMoptions::num_threads_SLU, SIMadmin::opt, SAM::print(), and LinAlg::SPARSE.

Referenced by MultiStepSIM::initEqSystem(), EigenModeSIM::initSol(), and AdaptiveSIM::solveStep().

◆ injectPatchSolution()

bool SIMbase::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.

Parameters
solGlobal primary solution vector in DOF-order
[in]vecLocal solution vector associated with specified patch
[in]pchThe patch to inject solution vector for
[in]nndofNumber of DOFs per node (optional)
[in]basisBasis to inject for (optional)

References getMADOF(), ASMbase::getNoFields(), ASMbase::injectNodalVec(), and ASMbase::injectNodeVec().

Referenced by project().

◆ iterationNorms()

void SIMbase::iterationNorms ( const Vector x,
const Vector r,
double &  eNorm,
double &  rNorm,
double &  dNorm 
) const
virtual

Evaluates some iteration norms for convergence assessment.

Parameters
[in]xGlobal primary solution vector
[in]rGlobal residual vector associated with the solution vector
[out]eNormEnergy norm of solution increment
[out]rNormResidual norm of solution increment
[out]dNormDisplacement norm of solution increment

References SAM::dot(), mySam, and SAM::norm2().

Referenced by NewmarkSIM::checkConvergence().

◆ merge()

bool SIMbase::merge ( SIMbase that,
const std::map< int, int > *  old2new = nullptr,
int  poff = 0 
)
virtual

Merges the global equation system of that simulator with this.

Parameters
thatThe simulator whose equation system is to be merged
[in]old2newGlobal node number mapping
[in]poffGlobal patch index offset

Reimplemented in SIMoutput.

References SIMadmin::adm, ProcessAdm::dd, SAM::getNoElms(), SAM::getNoNodes(), ASMbase::idx, mdFlag, SAM::merge(), myModel, mySam, DomainDecomposition::setup(), and shiftGlobalNums().

Referenced by SIMoutput::merge().

◆ preprocessC()

bool SIMbase::preprocessC ( const IntVec ignored,
bool  fixDup,
double  time0 
)
virtual

◆ printSolutionSummary()

void SIMbase::printSolutionSummary ( const Vector solution,
int  printSol = 0,
const char *  compName = nullptr,
std::streamsize  outPrec = 0 
)
virtual

Prints a summary of the calculated solution to std::cout.

Parameters
[in]solutionThe solution vector
[in]printSolPrint solution only if size is less than this value
[in]compNameSolution name to be used in norm output
[in]outPrecNumber of digits after the decimal point in norm print

References SIMadmin::adm, ProcessAdm::cout, dumpSolVec(), SAM::getNoEquations(), getNoFields(), mySam, nsd, utl::LogStream::precision(), SAM::printVector(), solutionNorms(), and utl::trunc().

Referenced by MultiStepSIM::solutionNorms(), and solveEqSystem().

◆ printStep()

void SIMbase::printStep ( int  istep,
const TimeDomain time 
) const
virtual

Prints out load/time step identification.

Parameters
[in]istepLoad- or time step counter
[in]timeParameters for nonlinear/time-dependent simulations

This method is used by multi-step simulators to print out a heading when starting a new load/time increment. Override this method if your simulator have some additional data to be printed.

References SIMadmin::adm, ProcessAdm::cout, and TimeDomain::t.

Referenced by MultiStepSIM::printStep().

◆ project() [1/3]

bool SIMbase::project ( Matrix ssol,
const Vector psol,
SIMoptions::ProjectionMethod  method = SIMoptions::GLOBAL,
const TimeDomain time = TimeDomain() 
) const
virtual

Projects the secondary solution associated with a primary solution.

Parameters
[out]ssolControl point values of the secondary solution
[in]psolControl point values of the primary solution
[in]methodProjection method to use
[in]timeParameters for nonlinear/time-dependent simulations

The secondary solution, defined through the Integrand object, corresponding to the primary solution psol is projected onto the spline basis to obtain the control point values of the secondary solution.

References SIMadmin::adm, utl::matrixBase< T >::clear(), utl::matrix< T >::cols(), IFEM::cout, utl::vector< T >::empty(), utl::matrixBase< T >::empty(), extractPatchSolution(), fieldProjections(), utl::matrix< T >::fillBlock(), utl::matrix< T >::fillColumn(), utl::matrix< T >::getColumn(), IntegrandBase::getNoFields(), getNoNodes(), IntegrandBase::initIntegration(), IntegrandBase::initResultPoints(), SIMadmin::msgLevel, myGl2Params, myModel, myProblem, SIMoptions::nGauss, SIMadmin::opt, LocalSystem::patch, PROFILE1, utl::matrix< T >::resize(), utl::matrix< T >::rows(), setPatchMaterial(), setQuadratureRule(), utl::vector< T >::size(), GlbL2::SolverParams, and TimeDomain::t.

Referenced by SIM2D::addConstraint(), SIM3D::addConstraint(), project(), projectAnaSol(), SIMinput::setInitialConditions(), and AdaptiveSIM::solveStep().

◆ project() [2/3]

bool SIMbase::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.

Parameters
[out]valuesResulting control point values
[in]fThe function to evaluate
[in]basisWhich basis to consider
[in]iFieldField component offset in values vector
[in]nFieldsNumber of field components in values vector
[in]methodProjection method to use
[in]timeCurrent time

References SIMadmin::adm, FunctionBase::dim(), injectPatchSolution(), myModel, and utl::vector< T >::size().

◆ project() [3/3]

bool SIMbase::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.

Parameters
[out]ssolVector of control point values of the secondary solution
[in]psolVector of control point values of the primary solution
[in]methodProjection method to use
[in]iCompOne-based index of the component to return (0 = all)

Convenience overload, for stationary problems only.

References utl::matrix< T >::getRow(), and project().

◆ projectAnaSol()

bool SIMbase::projectAnaSol ( Vector ssol,
SIMoptions::ProjectionMethod  method 
) const

Projects the analytical secondary solution, if any.

Parameters
[out]ssolVector of control point values of the secondary solution
[in]methodProjection method to use

References FunctionBase::dim(), AnaSol::getScalarSecSol(), AnaSol::getStressSol(), AnaSol::getVectorSecSol(), mySol, project(), and utl::vector< T >::resize().

◆ readModel()

bool SIMbase::readModel ( const char *  fileName)

Reads model data from the specified input file *fileName.

This method adds profiling to the virtual read() method.

References PROFILE1, and SIMadmin::read().

◆ registerDependency() [1/4]

void SIMbase::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.

Parameters
[in]nameName of field we depend on
[in]simThe SIM object holding the field we depend on
[in]nvcNumber of components in field
[in]basisThe basis the dependent field should be defined on

References getMADOF(), myModel, and registerDependency().

◆ registerDependency() [2/4]

void SIMdependency::registerDependency

Registers a dependency on a field from another SIM object.

Parameters
[in]simThe SIM object holding the field we depend on
[in]nameName of field we depend on
[in]nvcNumber of components in field
[in]patchesThe geometry the field is defined over
[in]diffBasisIf non-null, use diffBasis base from patch vector
[in]componentComponent to use from field

Referenced by registerDependency().

◆ registerDependency() [3/4]

void SIMdependency::registerDependency

Registers a dependency on a field from another SIM object.

Parameters
[in]simThe SIM object holding the field we depend on
[in]nameName of field we depend on
[in]nvcNumber of components in field
[in]patchesThe geometry the field is defined over
[in]MADOFThe MADOF array to associate with this field

References SIMdependency::depFields.

◆ registerDependency() [4/4]

void SIMdependency::registerDependency

Registers a dependency on a field from another SIM object.

Parameters
[in]simThe SIM object holding the field we depend on
[in]nameName of field we depend on
[in]nvcNumber of components in field

◆ renumberNodes()

int SIMbase::renumberNodes ( bool  renumMNPC = false)
protected

Renumbers the global node numbers after resolving patch topology.

Parameters
[in]renumMNPCIf true, also update element connectivity tables
Returns
Total number of unique nodes in the model, negative on error

This method renumbers the nodes to account for overlapping nodes for multi-patch models, duplicated nodes, erased patches, etc. In parallel simulations, the resulting mapping myGlb2Loc will map the global node numbers to local node numbers on the current processor. In serial simulations, this mapping will be unity unless the original global node number sequence had "holes" due to duplicated nodes or erased patches.

References IFEM::cout, g2l, myDegenElm, myGlb2Loc, myLoc2Glb, myModel, preserveNOrder, ASMbase::renumberNodes(), and ASMs2DC1::renumberNodes().

Referenced by preprocessC(), and SIMinput::readTopologyOnly().

◆ setAssociatedRHS()

bool SIMbase::setAssociatedRHS ( size_t  iMat,
size_t  iVec 
)

Associates a system vector to a system matrix.

See also
AlgEqSystem::setAssociatedVector
Parameters
[in]iMatIndex of a coefficient matrix
[in]iVecIndex of the system vector to associate with the matrix

References myEqSys, and AlgEqSystem::setAssociatedVector().

◆ setIntegrationPrm()

void SIMbase::setIntegrationPrm ( unsigned short int  i,
double  prm 
)

Initializes an integration parameter for the integrand.

Parameters
[in]iIndex of the integration parameter to define
[in]prmThe parameter value to assign

References IFEM::cout, myInts, myProblem, and IntegrandBase::setIntegrationPrm().

Referenced by GenAlphaSIM::initPrm(), HHTSIM::initPrm(), NewmarkNLSIM::initPrm(), NewmarkSIM::initPrm(), and NonLinSIM::initPrm().

◆ setMode()

bool SIMbase::setMode ( int  mode,
bool  needIntegr = true,
bool  resetSol = false 
)

Defines the solution mode before the element assembly is started.

Parameters
[in]modeThe solution mode to use
[in]needIntegrIf false, silently ignore non-existing integrand
[in]resetSolIf true, the internal solution vectors are cleared

References myInts, and myProblem.

Referenced by AdaptiveSIM::assembleAndSolveSystem(), assembleForces(), NewmarkSIM::initAcc(), EigenModeSIM::initSol(), NonLinSIM::lineSearch(), MultiStepSIM::saveStep(), NewmarkSIM::solveIteration(), NonLinSIM::solveIteration(), AdaptiveSIM::solveStep(), NewmarkSIM::solveStep(), and AdaptiveSIM::writeGlv().

◆ setQuadratureRule()

void SIMbase::setQuadratureRule ( size_t  ng,
bool  redimBuffers = false,
bool  printQP = false 
)

Defines the spatial numerical integration scheme to use.

Parameters
[in]ngNumber of Gauss points in each parameter direction
[in]redimBuffersToggle initialization of internal buffer arrays
[in]printQPIf true, print out total number of quadrature points

References IFEM::cout, IntegrandBase::hasBoundaryTerms(), myInts, myModel, myProblem, myProps, nBouGP, and nIntGP.

Referenced by AdaptiveSIM::assembleAndSolveSystem(), NewmarkSIM::initAcc(), EigenModeSIM::initSol(), project(), AdaptiveSIM::solveStep(), and NewmarkSIM::solveStep().

◆ setRefined()

void SIMbase::setRefined ( int  nref)
inline

Sets the refinement status (for restart of adaptive simulations).

Parameters
[in]nrefNumber of refinement levels so far

References isRefined.

◆ solutionNorms() [1/6]

bool SIMbase::solutionNorms ( const TimeDomain time,
const Vectors psol,
const Vectors ssol,
Vectors gNorm,
Matrix eNorm = nullptr,
const char *  name = nullptr 
)

Integrates some solution norm quantities.

Parameters
[in]timeParameters for nonlinear/time-dependent simulations
[in]psolPrimary solution vectors
[in]ssolSecondary solution vectors
[out]gNormGlobal norm quantities
[out]eNormElement-wise norm quantities
[in]nameName of solution being the source of calculation

This method has a similar loop structure as the assembleSystem() method, but the resulting integrals are now element norms (and global equivalents) instead of a global equation system.

If an analytical solution is provided, norms of the exact error in the solution are also computed. If projected secondary solutions are provided (i.e., ssol is not empty), norms of the difference between these solutions and the directly evaluated secondary solution are computed as well.

References SIMadmin::adm, ProcessAdm::allReduceAsSum(), GlbNorm::assemble(), utl::vector< T >::begin(), utl::vector< T >::clear(), utl::matrix< T >::cols(), IFEM::cout, ProcessAdm::dd, GlbNorm::delayAssembly(), externalEnergy(), extractPatchSolution(), extrFunc, fieldProjections(), IntegrandBase::getExtractionField(), getInterfaceChecker(), getMADOF(), SAM::getNoElms(), IntegrandBase::getNoFields(), getNoNodes(), IntegrandBase::getNormIntegrand(), getPatch(), IntegrandBase::initIntegration(), initMaterial(), initNeumann(), AnaSol::initPatch(), Integrand::INTERFACE_TERMS, DomainDecomposition::isPartitioned(), SIMadmin::msgLevel, myModel, myProblem, myProps, mySam, mySol, nBouGP, nIntGP, SIMadmin::opt, postProcessNorms(), PROFILE1, SIMoptions::project, utl::matrixBase< T >::ptr(), and utl::matrix< T >::resize().

◆ solutionNorms() [2/6]

bool SIMbase::solutionNorms ( const TimeDomain time,
const Vectors psol,
Vectors gNorm,
Matrix eNorm = nullptr 
)
inline

Integrates some solution norm quantities.

Parameters
[in]timeParameters for nonlinear/time-dependent simulations
[in]psolPrimary solution vectors
[out]gNormGlobal norm quantities
[out]eNormElement-wise norm quantities

Use this version if no projected solutions are needed/available.

References solutionNorms().

◆ solutionNorms() [3/6]

bool SIMbase::solutionNorms ( const Vector psol,
const Vectors ssol,
Matrix eNorm,
Vectors gNorm,
const char *  name = nullptr 
)
inline

Integrates some solution norm quantities.

Parameters
[in]psolPrimary solution vectors
[in]ssolSecondary solution vectors
[out]eNormElement-wise norm quantities
[out]gNormGlobal norm quantities
[in]nameName of solution being the source of calculation

Use this version for linear/stationary problems only.

References solutionNorms().

◆ solutionNorms() [4/6]

bool SIMbase::solutionNorms ( const Vector psol,
const Vectors ssol,
Vectors gNorm,
const char *  name = nullptr 
)
inline

Integrates some solution norm quantities.

Parameters
[in]psolPrimary solution vectors
[in]ssolSecondary solution vectors
[out]gNormGlobal norm quantities
[in]nameName of solution being the source of calculation

Use this version for linear/stationary problems, and when the element-wise norms are not needed.

References solutionNorms().

◆ solutionNorms() [5/6]

bool SIMbase::solutionNorms ( const Vector psol,
Matrix eNorm,
Vectors gNorm 
)
inline

Integrates some solution norm quantities.

Parameters
[in]psolPrimary solution vectors
[out]eNormElement-wise norm quantities
[out]gNormGlobal norm quantities

Use this version for linear/stationary problems, and when no projected solutions are needed/available.

References solutionNorms().

◆ solutionNorms() [6/6]

double SIMbase::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.

Parameters
[in]xGlobal primary solution vector
[out]infInfinity norms in each spatial direction
[out]indGlobal index of the node corresponding to the inf-value
[in]nfNumber of components in the primary solution field
[in]typeOnly consider nodes of this DOF type (for mixed methods)
Returns
L2-norm of the solution vector

References mySam, SAM::normInf(), SAM::normL2(), and nsd.

Referenced by NewmarkSIM::initAcc(), printSolutionSummary(), NewmarkSIM::solutionNorms(), solutionNorms(), and AdaptiveSIM::solveStep().

◆ solveEqSystem()

bool SIMbase::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.

Parameters
[out]solutionGlobal primary solution vector
[in]idxRHSIndex to the right-hand-side vector to solve for
[out]rCondReciprocal condition number
[in]compNameSolution name to be used in norm output
[in]printSolPrint solution if its size is less than printSol
[in]dumpEqSysIf true, activate dump of equation system to file

References IFEM::cout, dumpEqSys(), dumpSolVec(), SAM::expandSolution(), AlgEqSystem::getMatrix(), AlgEqSystem::getVector(), SystemMatrix::isZero(), SIMadmin::msgLevel, myEqSys, mySam, printSolutionSummary(), utl::profiler, SystemMatrix::solve(), Profiler::start(), and Profiler::stop().

Referenced by NewmarkSIM::initAcc(), NewmarkSIM::solveIteration(), NonLinSIM::solveIteration(), NewmarkSIM::solveStep(), and solveSystem().

◆ solveSystem() [1/3]

virtual bool SIMbase::solveSystem ( Vector solution,
int  printSol,
double *  rCond,
const char *  compName = "displacement",
size_t  idxRHS = 0 
)
inlinevirtual

Solves the assembled linear system of equations for a given load.

Parameters
[out]solutionGlobal primary solution vector
[in]printSolPrint solution if its size is less than printSol
[out]rCondReciprocal condition number
[in]compNameSolution name to be used in norm output
[in]idxRHSIndex to the right-hand-side vector to solve for

References solveEqSystem().

Referenced by AdaptiveSIM::assembleAndSolveSystem(), NewmarkSIM::solveStep(), and solveSystem().

◆ solveSystem() [2/3]

bool SIMbase::solveSystem ( Vector solution,
int  printSol = 0,
const char *  compName = "displacement" 
)
inline

Solves the assembled linear system of equations for a given load.

Parameters
[out]solutionGlobal primary solution vector
[in]printSolPrint solution if its size is less than printSol
[in]compNameSolution name to be used in norm output

References solveSystem().

◆ solveSystem() [3/3]

bool SIMbase::solveSystem ( Vectors solution,
int  printSol = 0,
const char *  cmpName = "displacement" 
)

Solves a linear system of equations with multiple right-hand-sides.

Parameters
[out]solutionGlobal primary solution vectors
[in]printSolPrint solution if its size is less than printSol
[in]cmpNameSolution name to be used in norm output

References AlgEqSystem::getNoRHS(), myEqSys, and solveSystem().

◆ systemModes() [1/2]

bool SIMbase::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.

Parameters
[in]iopWhich eigensolver method to use
[in]nevNumber of eigenvalues/vector (see ARPack documentation)
[in]ncvNumber of Arnoldi vectors (see ARPack documentation)
[in]shiftEigenvalue shift
[out]solutionComputed eigenvalues and associated eigenvectors
[in]iAIndex of system matrix A in myEqSys
[in]iBIndex of system matrix B in myEqSys

References IFEM::cout, dumpEqSys(), SAM::expandVector(), utl::matrix< T >::getColumn(), AlgEqSystem::getMatrix(), SAM::getNoEquations(), myEqSys, mySam, PROFILE1, eig::solve(), and utl::trunc().

Referenced by EigenModeSIM::initSol(), and systemModes().

◆ systemModes() [2/2]

bool SIMbase::systemModes ( std::vector< Mode > &  solution,
size_t  iA = 0,
size_t  iB = 1 
)
inline

Performs a generalized eigenvalue analysis of the assembled system.

Parameters
[out]solutionComputed eigenvalues and associated eigenvectors
[in]iAIndex of system matrix A in myEqSys
[in]iBIndex of system matrix B in myEqSys

References SIMoptions::eig, SIMoptions::ncv, SIMoptions::nev, SIMadmin::opt, SIMoptions::shift, and systemModes().

◆ updateDirichlet()

bool SIMbase::updateDirichlet ( double  time = 0.0,
const Vector prevSol = nullptr 
)
virtual

Updates the time-dependent in-homogeneous Dirichlet coefficients.

Parameters
[in]timeCurrent time
[in]prevSolPointer to previous primary solution in DOF-order

This method needs to be invoked in the beginning of each time/load step if the problem constains time-dependent in-homogeneous Dirchlet conditions.

If prevSol points to an empty vector, the coefficients of the MPC objects representing the in-homogeneous Dirichlet conditions are set to the current (updated) value of the SpatialFunction defining the Dirichlet condition (used for the initial time step), otherwise they are set to the difference between the new values from the function, and the previous value which is stored in the provided prevSol vector.

If prevSol is null, the Dirichlet coefficients are set to zero. This is used when doing equilibrium iterations on a fixed time level.

See also
ASMbase::updateDirichlet() and SAMpatch::updateConstraintEqs().

References myModel, mySam, myScalars, myVectors, and SAMpatch::updateConstraintEqs().

Referenced by initDirichlet(), NewmarkSIM::solveIteration(), NonLinSIM::solveIteration(), and NewmarkSIM::solveStep().

◆ updateForNewElements()

void SIMbase::updateForNewElements ( Vector solution,
const TimeDomain time 
) const

Modifies the current solution vector when activating elements.

Parameters
solutionCurrent primary solution vector
[in]timeParameters for nonlinear/time-dependent simulations

References utl::vector< T >::add(), TimeDomain::dt, utl::vector< T >::fill(), SAM::getEquation(), myModel, mySam, utl::vector< T >::ptr(), and TimeDomain::t.

Referenced by NonLinSIM::advanceStep().

◆ updateGrid() [1/2]

bool SIMbase::updateGrid ( const RealArray displ)

Updates the grid coordinates.

Parameters
[in]displThe displacement increment to update the grid with

References extractPatchSolution(), ASMmxBase::itgBasis, mixedProblem(), and myModel.

Referenced by updateGrid().

◆ updateGrid() [2/2]

bool SIMbase::updateGrid ( const std::string &  field)

Updates the grid coordinates.

Parameters
[in]fieldName of the displacement increment field to update with

References SIMdependency::getDependentField(), getName(), and updateGrid().

Member Data Documentation

◆ nGlbNodes

int SIMbase::nGlbNodes
protected

Total number of unique nodes in the model.

This variable is only used to carry the number of nodes in the model, in the case that renumberNodes() is called before preprocess() and until the SAMpatch::init() method is invoked. This value will be equal to SAM::getNoNodes('A').

Referenced by clearProperties(), getNoNodes(), preprocessC(), SIMinput::readTopologyOnly(), and SIMbase().


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