|
IFEM
90A354
|
Base class for NURBS-based FEM simulators. More...
#include <SIMbase.h>


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 IntegrandBase * | getProblem () const |
| Returns a pointer to the problem-specific data object. | |
| virtual ASM::InterfaceChecker * | getInterfaceChecker (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 LinSolParams * | getSolParams () 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< IntVec > | getElmConnectivities () 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 RealArray * | getReactionForces () 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. | |
| NormBase * | getNormIntegrand () const |
| Returns a pointer to a norm integrand object for this simulator. More... | |
| ForceBase * | getBoundaryForceIntegrand (const Vec3 *X0=nullptr) const |
| Returns a pointer to a force integrand object for this simulator. More... | |
| ForceBase * | getNodalForceIntegrand () const |
| Returns a pointer to a force integrand object for this simulator. More... | |
| const SAM * | getSAM () 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 PatchVec & | getFEModel () const |
| Returns a const reference to our FEM model. | |
| ASMbase * | getPatch (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. | |
| SystemMatrix * | getRayleighDampingMatrix (size_t iM=1, size_t iK=0) const |
| Returns current Rayleigh system damping matrix. More... | |
| SystemMatrix * | getLHSmatrix (size_t idx=0, bool copy=false) const |
| Returns current system left-hand-side matrix. | |
| SystemVector * | getRHSvector (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. | |
| RealFunc * | getSclFunc (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 ProcessAdm & | getProcessAdm () const |
| Returns the parallel process administrator. | |
| int | getGlobalProcessID () const |
| Returns the global process ID. More... | |
| const std::string & | getHeading () const |
| Returns the simulator heading. | |
| void | setHeading (const std::string &heading) |
| Defines the simulator heading. | |
| void | printHeading (int &supStep) const |
| Prints the heading of this simulator, if any, to IFEM::cout. | |
Public Member Functions inherited from XMLInputBase | |
| bool | readXML (const char *fileName, bool verbose=true) |
| Reads an XML input file. More... | |
| bool | loadXML (const char *xml) |
| Loads data from an XML-formatted text string. More... | |
Public Member Functions inherited from 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. | |
| ASMbase * | getDependentPatch (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. | |
| VecFunc * | getVecFunc (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. | |
| IntegrandBase * | myProblem |
| The main integrand of this simulator. | |
| IntegrandMap | myInts |
| Set of all integrands involved. | |
| AnaSol * | mySol |
| Analytical/Exact solution. | |
| FunctionBase * | dualField |
| 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< DumpData > | lhsDump |
| Coefficient matrix dump specifications. | |
| std::vector< DumpData > | rhsDump |
| Right-hand-side vector dump specifications. | |
| std::vector< DumpData > | solDump |
| 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. | |
| AlgEqSystem * | myEqSys |
| The actual linear equation system. | |
| SAM * | mySam |
| Auxiliary data for FE assembly management. | |
| LinSolParams * | mySolParams |
| Input parameters for PETSc. | |
| LinSolParams * | myGl2Params |
| 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 IntVec & | getMADOF (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, IntVec > | extraMADOFs |
| 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 | |
| SIMoptions & | opt |
| Simulation control parameters. | |
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.
|
protectedvirtual |
Preprocesses a user-defined Dirichlet boundary property.
| [in] | patch | 1-based index of the patch to receive the property |
| [in] | lndx | Local index of the boundary item to receive the property |
| [in] | ldim | Dimension of the boundary item to receive the property |
| [in] | dirs | Which local DOFs to constrain |
| [in] | code | In-homogeneous Dirichlet condition property code |
| ngnod | Total number of global nodes in the model (might be updated) | |
| [in] | basis | Which basis to apply the constraint to (mixed methods) |
| [in] | ovrD | If 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().
|
protected |
Adds a MADOF with an extraordinary number of DOFs on a given basis.
| [in] | basis | The basis to specify number of DOFs for |
| [in] | nndof | Number of nodal DOFs on the given basis |
| [in] | other | If true, include other bases in MADOF as well |
References extraMADOFs, getNoNodes(), and myModel.
| bool SIMbase::applyDirichlet | ( | Vector & | glbVec | ) | const |
Applies the Dirichlet conditions to given vector.
| [out] | glbVec | Global vector in DOF-order |
References SAM::applyDirichlet(), and mySam.
|
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().
| bool SIMbase::assembleForces | ( | const Vector & | solution, |
| double | t0, | ||
| RealArray * | R, | ||
| Vector * | S = nullptr |
||
| ) |
Assembles reaction and interface forces for specified boundaries.
| [in] | solution | Current primary solution vector |
| [in] | t0 | Current time (for time-dependent loads) |
| [out] | R | Nodal reaction force container |
| [out] | S | Nodal interface force container |
References SIMadmin::adm, assembleSystem(), myEqSys, myProblem, mySam, setMode(), and IntegrandBase::setSecondaryInt().
|
virtual |
Administers assembly of the linear equation system.
| [in] | time | Parameters for nonlinear/time-dependent simulations |
| [in] | prevSol | Previous primary solution vectors in DOF-order |
| [in] | newLHSmatrix | If false, only integrate the RHS vector |
| [in] | poorConvg | If 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().
Administers assembly of the linear equation system.
| [in] | t0 | Time for evaluation of time-dependent property functions |
| [in] | pSol | Primary solution vectors in DOF-order |
Use this version for linear/stationary problems only.
References assembleSystem().
|
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.
|
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().
| bool SIMbase::evalSecondarySolution | ( | Matrix & | field, |
| int | pindx | ||
| ) | const |
Evaluates the secondary solution field for specified patch.
| [out] | field | Control point values of the secondary solution field |
| [in] | pindx | Local 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().
| bool SIMbase::extractLoadVec | ( | Vector & | loadVec, |
| size_t | idx = 0, |
||
| const char * | hd = nullptr |
||
| ) | const |
Extracts the assembled load vector for inspection/visualization.
| [out] | loadVec | Global load vector in DOF-order |
| [in] | idx | Index to the system vector to extract |
| [in] | hd | Header 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().
Extracts element results for a specified patch.
| [in] | glbRes | Global element result array |
| [out] | elRes | Patch-level element result array |
| [in] | pindx | Local patch index to extract element results for |
References utl::matrixBase< T >::empty(), ASMbase::extractElmRes(), and getPatch().
Referenced by HDF5Writer::writeKnotspan(), and HDF5Writer::writeSIM().
| 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.
| [in] | sol | Global primary solution vector in DOF-order |
| [out] | vec | Local solution vector associated with specified patch |
| [in] | pch | The patch to extract solution vector for |
| [in] | nndof | Number of DOFs per node (optional) |
| [in] | basis | Basis to extract for (optional) |
References ASMbase::empty(), ASMbase::extractNodalVec(), ASMbase::extractNodeVec(), extraMADOFs, SAM::getMADOF(), getMADOF(), ASMbase::getNodeID(), ASMbase::getNodeType(), ASMbase::getNoFields(), SAM::getNoNodes(), ASMbase::getNoNodes(), myModel, and mySam.
|
inline |
Extracts all local solution vector(s) for a specified patch.
| [in] | sol | Global primary solution vectors in DOF-order |
| [in] | pindx | Local patch index to extract solution vectors for |
References extractPatchSolution(), and myProblem.
|
protectedvirtual |
Extracts all local solution vector(s) for a specified patch.
| [in] | problem | The integrand to receive patch-level solution vectors |
| [in] | sol | Global primary solution vectors in DOF-order |
| [in] | pindx | Local 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().
|
protected |
Generates element groups for multi-threading of boundary integrals.
| [in] | p | Property object identifying a patch boundary |
| [in] | silence | If true, suppress threading group outprint |
References ASMbase::empty(), ASMbase::generateThreadGroups(), ASMbase::getNoParamDim(), getPatch(), lagMTOK, Property::ldim, Property::lindx, and Property::patch.
Returns a pointer to a force integrand object for this simulator.
References IntegrandBase::getForceIntegrand(), myProblem, and mySol.
Referenced by SIM::getBoundaryForce().
| void SIMbase::getBoundaryNodes | ( | int | pcode, |
| IntVec & | glbNodes, | ||
| std::vector< Vec3 > * | XYZ = nullptr |
||
| ) | const |
Finds the list of global nodes associated with a boundary.
| [in] | pcode | Property code identifying the boundary |
| [out] | glbNodes | Global node numbers on the boundary |
| [out] | XYZ | Spatial 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().
Computes the total reaction forces in the model.
| [out] | RF | Reaction force in each spatial direction + energy |
| [in] | psol | Primary solution vector |
| [in] | pcode | Property 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().
| int SIMbase::getLocalPatchIndex | ( | int | patchNo | ) | const |
Returns the local patch index for the given global patch number.
For serial applications this is an identity mapping only, whereas for parallel applications the local (1-based) patch index on the current processor is returned. If patchNo is out of range, -1 is returned. If patchNo is not on current processor, 0 is returned.
References myPatches, nGlPatches, and SIMadmin::nProc.
Referenced by DomainDecomposition::calcGlobalEqNumbers(), DomainDecomposition::calcGlobalNodeNumbers(), SIM2D::connectPatches(), SIM3D::connectPatches(), SIM1D::connectPatches(), MultiPatchModelGenerator1D::createTopologySets(), MultiPatchModelGenerator2D::createTopologySets(), MultiPatchModelGenerator3D::createTopologySets(), getPatch(), SIMoutput::initPatchForEvaluation(), SIM2D::parse(), SIM3D::parse(), SIMinput::parse(), SIM1D::parseBCTag(), SIM2D::parseBCTag(), SIM3D::parseBCTag(), SIMinput::parseBCTag(), SIM2D::readNodes(), SIM3D::readNodes(), SIMinput::readPatches(), DomainDecomposition::sanityCheckCorners(), SIMoutput::savePoints(), SIMinput::setInitialCondition(), HDF5Writer::writeKnotspan(), and HDF5Writer::writeSIM().
|
private |
Returns an extraordinary MADOF array.
| [in] | basis | The basis to specify number of DOFs for |
| [in] | nndof | Number of nodal DOFs on the given basis |
References extraMADOFs.
Referenced by extractPatchSolution(), injectPatchSolution(), registerDependency(), and solutionNorms().
|
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().
| ForceBase * SIMbase::getNodalForceIntegrand | ( | ) | const |
Returns a pointer to a force integrand object for this simulator.
References IntegrandBase::getForceIntegrand(), and myProblem.
Referenced by SIM::getNodalForces().
| 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().
| size_t SIMbase::getNoElms | ( | bool | includeXelms = false, |
| bool | includeZelms = false |
||
| ) | const |
Returns the model size in terms of number of elements.
| [in] | includeXelms | If true, include any extra-ordinary elements |
| [in] | includeZelms | If 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().
| size_t SIMbase::getNoFields | ( | int | basis = 0 | ) | const |
Returns the number of primary solution fields.
| [in] | basis | Which basis to consider when mixed methods (0 = all) |
References myModel.
Referenced by SIMoutput::dumpVector(), NodeVecFunc::evaluate(), NewmarkSIM::initAcc(), SIMinput::parseBCTag(), HHTSIM::predictStep(), NewmarkNLSIM::predictStep(), NewmarkSIM::predictStep(), printSolutionSummary(), NewmarkSIM::saveStep(), SIMinput::setInitialCondition(), SIMinput::setNeumann(), NewmarkSIM::solutionNorms(), NonLinSIM::updateConfiguration(), SIMoutput::writeGlvS1(), and SIMoutput::writeGlvS2().
| size_t SIMbase::getNoNodes | ( | int | basis = 0 | ) | const |
Returns the model size in terms of number of unique nodes.
| [in] | basis | Which basis to return the number of nodes for (0 = all) |
References SAM::getNoNodes(), myModel, mySam, and nGlbNodes.
Referenced by addMADOF(), SIMoutput::dumpMatlabGrid(), SIMoutput::dumpVector(), HHTSIM::predictStep(), NewmarkNLSIM::predictStep(), NewmarkSIM::predictStep(), project(), SIMinput::refine(), solutionNorms(), NonLinSIM::updateConfiguration(), SIMoutput::writeGlvNo(), SIMoutput::writeGlvP(), and SIMoutput::writeGlvS().
| NormBase * SIMbase::getNormIntegrand | ( | ) | const |
Returns a pointer to a norm integrand object for this simulator.
References IntegrandBase::getNormIntegrand(), myProblem, and mySol.
Referenced by AdaptiveSetup::initPrm(), AdaptiveSetup::printNorms(), SIMgeneric::printNorms(), and HDF5Writer::writeSIM().
| ASMbase * SIMbase::getPatch | ( | int | idx, |
| bool | glbIndex = false |
||
| ) | const |
Returns a pointer to a specified patch of our FEM model.
| [in] | idx | 1-based patch index |
| [in] | glbIndex | If true, the patch index is assumed to be global for the whole model, otherwise it is assumed local within current process. For serial applications this option has no effect. |
References getLocalPatchIndex(), and myModel.
Referenced by assembleSystem(), DomainDecomposition::calcGlobalEqNumbers(), DomainDecomposition::calcGlobalNodeNumbers(), AdaptiveSetup::calcRefinement(), compute(), MultiPatchModelGenerator1D::createTopology(), MultiPatchModelGenerator2D::createTopology(), MultiPatchModelGenerator3D::createTopology(), SIMoutput::dumpMatlabGrid(), SIMgeneric::evalPoint(), evalSecondarySolution(), extractPatchElmRes(), extractPatchSolution(), SIMgeneric::findElementContaining(), generateThreadGroups(), getBoundaryNodes(), NodeVecFunc::getPointIndex(), SIMgeneric::getSolution(), SIMinput::getTopItemNodes(), SIM::integrate(), SIMoutput::merge(), SIM1D::parse(), SIM2D::parse(), SIM3D::parse(), SIMinput::parseBCTag(), SIMinput::parseDualTag(), SIM1D::parseGeometryTag(), SIM2D::parseGeometryTag(), SIM3D::parseGeometryTag(), SIMinput::parsePeriodic(), preprocessC(), SIMoutput::preprocessResPtGroup(), SIMinput::refine(), DomainDecomposition::sanityCheckCorners(), SIMinput::setPropertyType(), DomainDecomposition::setup(), solutionNorms(), and HDF5Writer::writeSIM().
| SystemMatrix * SIMbase::getRayleighDampingMatrix | ( | size_t | iM = 1, |
| size_t | iK = 0 |
||
| ) | const |
Returns current Rayleigh system damping matrix.
| [in] | iM | Index of the system mass matrix |
| [in] | iK | Index of the system stiffness matrix |
References SystemMatrix::add(), IntegrandBase::getIntegrationPrm(), getLHSmatrix(), SystemMatrix::mult(), myEqSys, and myProblem.
|
protected |
| 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.
| [in] | x | Global primary solution vector |
| [in] | r | Global residual vector associated with the solution vector |
| [in] | nWorst | How many bad DOFs to detect |
| [in] | eps | Only record values larger than this tolerance |
| [in] | iteNorm | Which norm to consider (1=res, 2=dis, 3=energy) |
| [out] | worst | Node and local DOF number and values of the worst DOFs |
References SAM::getNodeAndLocalDof(), mySam, and utl::vector< T >::size().
Referenced by NonLinSIM::printWorst().
| bool SIMbase::haveReactions | ( | int | pcode = 0 | ) | const |
Checks for total reaction forces associated with a boundary.
| [in] | pcode | Property code identifying the boundary (0 = all) |
References getBoundaryNodes(), SAM::haveReaction(), mySam, and nsd.
| bool SIMbase::initDirichlet | ( | double | time = 0.0 | ) |
Initializes time-dependent in-homogeneous Dirichlet coefficients.
| [in] | time | Current time |
References updateDirichlet().
Referenced by preprocessC().
| 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.
| [in] | mType | The matrix format to use |
| [in] | nMats | Number of system matrices |
| [in] | nVec | Number of system right-hand-side vectors |
| [in] | nScl | Number of global scalar quantities |
| [in] | withRF | Whether 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().
| 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.
| sol | Global primary solution vector in DOF-order | |
| [in] | vec | Local solution vector associated with specified patch |
| [in] | pch | The patch to inject solution vector for |
| [in] | nndof | Number of DOFs per node (optional) |
| [in] | basis | Basis to inject for (optional) |
References getMADOF(), ASMbase::getNoFields(), ASMbase::injectNodalVec(), and ASMbase::injectNodeVec().
Referenced by project().
|
virtual |
Evaluates some iteration norms for convergence assessment.
| [in] | x | Global primary solution vector |
| [in] | r | Global residual vector associated with the solution vector |
| [out] | eNorm | Energy norm of solution increment |
| [out] | rNorm | Residual norm of solution increment |
| [out] | dNorm | Displacement norm of solution increment |
References SAM::dot(), mySam, and SAM::norm2().
Referenced by NewmarkSIM::checkConvergence().
|
virtual |
Merges the global equation system of that simulator with this.
| that | The simulator whose equation system is to be merged | |
| [in] | old2new | Global node number mapping |
| [in] | poff | Global 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().
|
virtual |
Performs some pre-processing tasks on the FE model.
| [in] | ignored | Indices of patches to ignore in the analysis |
| [in] | fixDup | Merge duplicated FE nodes on patch interfaces? |
| [in] | time0 | Initial time for time-dependent dirichlet conditions |
Reimplemented from SIMadmin.
References addConstraint(), SIMadmin::adm, ASMbase::clear(), IFEM::cout, createFEMmodel(), ProcessAdm::dd, ASMbase::empty(), g2l, getName(), IntegrandBase::getNodalDofTypes(), SAM::getNoDOFs(), getNoParamDim(), getPatch(), hasTimeDependentDirichlet(), initDirichlet(), isRefined, lagMTOK, mdFlag, ASMbase::mergeAndGetAllMPCs(), SIMadmin::msgLevel, myDupNodes, SIMadmin::myHeading, myModel, myProblem, myProps, mySam, mySol, nDofS, nGlbNodes, SIMadmin::opt, LinAlg::PETSC, preprocessA(), preprocessB(), preprocessBeforeAsmInit(), preprocessResultPoints(), SIMadmin::printHeading(), PROFILE1, renumberNodes(), ASMbase::resetNumbering(), ASMbase::resolveMPCchains(), DomainDecomposition::setup(), AnaSol::setupSecondarySolutions(), SIMoptions::solver, and SIMoptions::validateGroups.
Referenced by AdaptiveSIM::preprocessC().
|
virtual |
Prints a summary of the calculated solution to std::cout.
| [in] | solution | The solution vector |
| [in] | printSol | Print solution only if size is less than this value |
| [in] | compName | Solution name to be used in norm output |
| [in] | outPrec | Number 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().
|
virtual |
Prints out load/time step identification.
| [in] | istep | Load- or time step counter |
| [in] | time | Parameters 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().
|
virtual |
Projects the secondary solution associated with a primary solution.
| [out] | ssol | Control point values of the secondary solution |
| [in] | psol | Control point values of the primary solution |
| [in] | method | Projection method to use |
| [in] | time | Parameters 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().
| 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.
| [out] | values | Resulting control point values |
| [in] | f | The function to evaluate |
| [in] | basis | Which basis to consider |
| [in] | iField | Field component offset in values vector |
| [in] | nFields | Number of field components in values vector |
| [in] | method | Projection method to use |
| [in] | time | Current time |
References SIMadmin::adm, FunctionBase::dim(), injectPatchSolution(), myModel, and utl::vector< T >::size().
| 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.
| [out] | ssol | Vector of control point values of the secondary solution |
| [in] | psol | Vector of control point values of the primary solution |
| [in] | method | Projection method to use |
| [in] | iComp | One-based index of the component to return (0 = all) |
Convenience overload, for stationary problems only.
References utl::matrix< T >::getRow(), and project().
| bool SIMbase::projectAnaSol | ( | Vector & | ssol, |
| SIMoptions::ProjectionMethod | method | ||
| ) | const |
Projects the analytical secondary solution, if any.
| [out] | ssol | Vector of control point values of the secondary solution |
| [in] | method | Projection method to use |
References FunctionBase::dim(), AnaSol::getScalarSecSol(), AnaSol::getStressSol(), AnaSol::getVectorSecSol(), mySol, project(), and utl::vector< T >::resize().
| 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().
| 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.
| [in] | name | Name of field we depend on |
| [in] | sim | The SIM object holding the field we depend on |
| [in] | nvc | Number of components in field |
| [in] | basis | The basis the dependent field should be defined on |
References getMADOF(), myModel, and registerDependency().
| void SIMdependency::registerDependency |
Registers a dependency on a field from another SIM object.
| [in] | sim | The SIM object holding the field we depend on |
| [in] | name | Name of field we depend on |
| [in] | nvc | Number of components in field |
| [in] | patches | The geometry the field is defined over |
| [in] | diffBasis | If non-null, use diffBasis base from patch vector |
| [in] | component | Component to use from field |
Referenced by registerDependency().
| void SIMdependency::registerDependency |
Registers a dependency on a field from another SIM object.
| [in] | sim | The SIM object holding the field we depend on |
| [in] | name | Name of field we depend on |
| [in] | nvc | Number of components in field |
| [in] | patches | The geometry the field is defined over |
| [in] | MADOF | The MADOF array to associate with this field |
References SIMdependency::depFields.
| void SIMdependency::registerDependency |
|
protected |
Renumbers the global node numbers after resolving patch topology.
| [in] | renumMNPC | If true, also update element connectivity tables |
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().
| bool SIMbase::setAssociatedRHS | ( | size_t | iMat, |
| size_t | iVec | ||
| ) |
Associates a system vector to a system matrix.
| [in] | iMat | Index of a coefficient matrix |
| [in] | iVec | Index of the system vector to associate with the matrix |
References myEqSys, and AlgEqSystem::setAssociatedVector().
| void SIMbase::setIntegrationPrm | ( | unsigned short int | i, |
| double | prm | ||
| ) |
Initializes an integration parameter for the integrand.
| [in] | i | Index of the integration parameter to define |
| [in] | prm | The 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().
| bool SIMbase::setMode | ( | int | mode, |
| bool | needIntegr = true, |
||
| bool | resetSol = false |
||
| ) |
Defines the solution mode before the element assembly is started.
| [in] | mode | The solution mode to use |
| [in] | needIntegr | If false, silently ignore non-existing integrand |
| [in] | resetSol | If 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().
| void SIMbase::setQuadratureRule | ( | size_t | ng, |
| bool | redimBuffers = false, |
||
| bool | printQP = false |
||
| ) |
Defines the spatial numerical integration scheme to use.
| [in] | ng | Number of Gauss points in each parameter direction |
| [in] | redimBuffers | Toggle initialization of internal buffer arrays |
| [in] | printQP | If 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().
|
inline |
Sets the refinement status (for restart of adaptive simulations).
| [in] | nref | Number of refinement levels so far |
References isRefined.
| 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.
| [in] | time | Parameters for nonlinear/time-dependent simulations |
| [in] | psol | Primary solution vectors |
| [in] | ssol | Secondary solution vectors |
| [out] | gNorm | Global norm quantities |
| [out] | eNorm | Element-wise norm quantities |
| [in] | name | Name 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().
|
inline |
Integrates some solution norm quantities.
| [in] | time | Parameters for nonlinear/time-dependent simulations |
| [in] | psol | Primary solution vectors |
| [out] | gNorm | Global norm quantities |
| [out] | eNorm | Element-wise norm quantities |
Use this version if no projected solutions are needed/available.
References solutionNorms().
|
inline |
Integrates some solution norm quantities.
| [in] | psol | Primary solution vectors |
| [in] | ssol | Secondary solution vectors |
| [out] | eNorm | Element-wise norm quantities |
| [out] | gNorm | Global norm quantities |
| [in] | name | Name of solution being the source of calculation |
Use this version for linear/stationary problems only.
References solutionNorms().
|
inline |
Integrates some solution norm quantities.
| [in] | psol | Primary solution vectors |
| [in] | ssol | Secondary solution vectors |
| [out] | gNorm | Global norm quantities |
| [in] | name | Name 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().
Integrates some solution norm quantities.
| [in] | psol | Primary solution vectors |
| [out] | eNorm | Element-wise norm quantities |
| [out] | gNorm | Global norm quantities |
Use this version for linear/stationary problems, and when no projected solutions are needed/available.
References solutionNorms().
| 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.
| [in] | x | Global primary solution vector |
| [out] | inf | Infinity norms in each spatial direction |
| [out] | ind | Global index of the node corresponding to the inf-value |
| [in] | nf | Number of components in the primary solution field |
| [in] | type | Only consider nodes of this DOF type (for mixed methods) |
References mySam, SAM::normInf(), SAM::normL2(), and nsd.
Referenced by NewmarkSIM::initAcc(), printSolutionSummary(), NewmarkSIM::solutionNorms(), solutionNorms(), and AdaptiveSIM::solveStep().
| 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.
| [out] | solution | Global primary solution vector |
| [in] | idxRHS | Index to the right-hand-side vector to solve for |
| [out] | rCond | Reciprocal condition number |
| [in] | compName | Solution name to be used in norm output |
| [in] | printSol | Print solution if its size is less than printSol |
| [in] | dumpEqSys | If 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().
|
inlinevirtual |
Solves the assembled linear system of equations for a given load.
| [out] | solution | Global primary solution vector |
| [in] | printSol | Print solution if its size is less than printSol |
| [out] | rCond | Reciprocal condition number |
| [in] | compName | Solution name to be used in norm output |
| [in] | idxRHS | Index to the right-hand-side vector to solve for |
References solveEqSystem().
Referenced by AdaptiveSIM::assembleAndSolveSystem(), NewmarkSIM::solveStep(), and solveSystem().
|
inline |
Solves the assembled linear system of equations for a given load.
| [out] | solution | Global primary solution vector |
| [in] | printSol | Print solution if its size is less than printSol |
| [in] | compName | Solution name to be used in norm output |
References solveSystem().
| bool SIMbase::solveSystem | ( | Vectors & | solution, |
| int | printSol = 0, |
||
| const char * | cmpName = "displacement" |
||
| ) |
Solves a linear system of equations with multiple right-hand-sides.
| [out] | solution | Global primary solution vectors |
| [in] | printSol | Print solution if its size is less than printSol |
| [in] | cmpName | Solution name to be used in norm output |
References AlgEqSystem::getNoRHS(), myEqSys, and solveSystem().
| 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.
| [in] | iop | Which eigensolver method to use |
| [in] | nev | Number of eigenvalues/vector (see ARPack documentation) |
| [in] | ncv | Number of Arnoldi vectors (see ARPack documentation) |
| [in] | shift | Eigenvalue shift |
| [out] | solution | Computed eigenvalues and associated eigenvectors |
| [in] | iA | Index of system matrix A in myEqSys |
| [in] | iB | Index 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().
|
inline |
Performs a generalized eigenvalue analysis of the assembled system.
| [out] | solution | Computed eigenvalues and associated eigenvectors |
| [in] | iA | Index of system matrix A in myEqSys |
| [in] | iB | Index of system matrix B in myEqSys |
References SIMoptions::eig, SIMoptions::ncv, SIMoptions::nev, SIMadmin::opt, SIMoptions::shift, and systemModes().
|
virtual |
Updates the time-dependent in-homogeneous Dirichlet coefficients.
| [in] | time | Current time |
| [in] | prevSol | Pointer 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.
References myModel, mySam, myScalars, myVectors, and SAMpatch::updateConstraintEqs().
Referenced by initDirichlet(), NewmarkSIM::solveIteration(), NonLinSIM::solveIteration(), and NewmarkSIM::solveStep().
| void SIMbase::updateForNewElements | ( | Vector & | solution, |
| const TimeDomain & | time | ||
| ) | const |
Modifies the current solution vector when activating elements.
| solution | Current primary solution vector | |
| [in] | time | Parameters 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().
| bool SIMbase::updateGrid | ( | const RealArray & | displ | ) |
Updates the grid coordinates.
| [in] | displ | The displacement increment to update the grid with |
References extractPatchSolution(), ASMmxBase::itgBasis, mixedProblem(), and myModel.
Referenced by updateGrid().
| bool SIMbase::updateGrid | ( | const std::string & | field | ) |
Updates the grid coordinates.
| [in] | field | Name of the displacement increment field to update with |
References SIMdependency::getDependentField(), getName(), and updateGrid().
|
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().