|
IFEM
90A354
|
Generic SIM class with some added functionalities. More...
#include <SIMgeneric.h>


Public Member Functions | |
| virtual | ~SIMgeneric () |
| Empty destructor. | |
| ASMbase * | createDefaultModel () |
| Creates a model with the default geometry (line, plane, cube). More... | |
| RealArray | getSolution (const Vector &psol, const double *par, int deriv=0, int patch=1) const |
| Evaluates the primary solution at the given point. More... | |
| int | evalPoint (const double *xi, Vec3 &X, double *param=nullptr, int patch=1, bool global=false) const |
| Evaluates the mapping of the geometry at the given point. More... | |
| RealArray | getInterfaceForces (const RealArray &sf, const RealArray &weights, int code) const |
| Extracts the force resultant on a specified interface. More... | |
| int | findElementContaining (const double *param, int patch=1, bool global=false) const |
| Returns the element that contains a specified spatial point. More... | |
| virtual bool | calcBouForces (Real2DMat &, const Vectors &) |
| Calculates surface traction resultants. | |
| size_t | getVCPindex (size_t idx=1) const |
| Returns the norm index for the a VCP-recovered quantity. | |
| virtual size_t | getVolumeIndex () const |
| Returns the norm index for the integrated volume (3D) or area (2D). | |
| virtual void | printNorms (const Vectors &gNorm, size_t w=36) const |
| Prints integrated solution norms to the log stream. More... | |
| virtual void | printNormGroup (const Vector &, const Vector &, const std::string &) const |
| Prints a norm group to the log stream (app-specific). | |
| virtual double | getReferenceNorm (const Vectors &gNorm, size_t adaptor) const |
| Returns the reference norm to base mesh adaptation upon. More... | |
| virtual double | getEffectivityIndex (const Vectors &gNorm, size_t idx, size_t inorm) const |
| Returns the global effectivity index. More... | |
| virtual bool | staticCondensation (Matrix &, Vector &) |
| Interface for static condensation of the linear equation system. | |
| virtual bool | recoverInternals (const Vector &, Vector &) |
| Interface for recovery of internal DOFs from static condensation. | |
| virtual std::string | getSupelName () const |
| Interface for returning the superelement file name, if any. | |
| virtual void | dumpSupernodes (std::ostream &) const |
| Interface for dumping supernode coordinates to file. | |
Public Member Functions inherited from SIMoutput | |
| virtual | ~SIMoutput () |
| The destructor frees the dynamically allocated VTF object. | |
| virtual void | clearProperties () |
| Initializes the property containers of the model. | |
| virtual bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| virtual bool | merge (SIMbase *that, const std::map< int, int > *old2new, int poff) |
| Merges the global equation system of that simulator with this. More... | |
| bool | getElementSet (int iset, std::string &name, RealArray &elSet) const |
| Retrieves the specified element set as a scalar field. More... | |
| virtual bool | writeGlvG (int &nBlock, const char *inpFile, bool doClear=true) |
| Writes current model geometry to the VTF-file. More... | |
| bool | writeGlvG (int &nBlock, double time) |
| Writes current model geometry to the currently open VTF-file. More... | |
| virtual bool | writeGlvA (int &, int, double, int=1) const |
| Writes additional, problem-specific, results to the VTF-file. | |
| bool | writeGlvBC (int &nBlock, int iStep=1) const |
| Writes boundary conditions as scalar fields to the VTF-file. More... | |
| bool | writeGlvNo (int &nBlock, int &idBlock, int maxBlock=20, int iStep=1) const |
| Writes global node numbers as scalar fields to the VTF-file. More... | |
| bool | writeGlvT (int iStep, int &geoBlk, int &nBlock) const |
| Writes boundary tractions for a given time step to the VTF-file. More... | |
| bool | writeGlvV (const RealArray &vec, const char *fieldName, int iStep, int &nBlock, int idBlock=2, int ncmp=0) const |
| Writes a vector field for a given load/time step to the VTF-file. More... | |
| bool | writeGlvS (const Vector &scl, const char *fieldName, int iStep, int &nBlock, int idBlock=2) const |
| Writes a scalar field for a given load/time step to the VTF-file. More... | |
| bool | writeGlvS (const Vector &psol, int iStep, int &nBlock, double time=0.0, const char *pvecName=nullptr, int idBlock=10, int psolComps=0) |
| Writes solution fields for a given load/time step to the VTF-file. More... | |
| virtual int | writeGlvS1 (const Vector &psol, int iStep, int &nBlock, double time=0.0, const char *pvecName=nullptr, int idBlock=10, int psolComps=0, bool scalarOnly=false) |
| Writes primary solution for a given load/time step to the VTF-file. More... | |
| virtual int | writeGlvS2 (const Vector &psol, int iStep, int &nBlock, double time=0.0, int idBlock=20, int psolComps=0) |
| Writes secondary solution for a load/time step to the VTF-file. More... | |
| bool | eval2ndSolution (const Vector &psol, double time, int psolComps=0) |
| Evaluates the secondary solution for a given load/time step. More... | |
| bool | writeGlvP (const RealArray &ssol, int iStep, int &nBlock, int idBlock=100, const char *prefix="Global projected", std::vector< PointValues > *maxVal=nullptr) |
| Writes projected solutions for a given time step to the VTF-file. More... | |
| bool | writeGlvM (const Mode &mode, bool freq, int &nBlock) |
| Writes a mode shape to the VTF-file. More... | |
| bool | writeGlvE (const Vector &field, int iStep, int &nBlock, const char *name, int idBlock=300, bool internalOrder=false) const |
| Writes element field for a given load/time step to the VTF-file. More... | |
| bool | writeGlvN (const Matrix &norms, int iStep, int &nBlock, const std::vector< std::string > &prefix={}, int idBlock=200, const char *dualPrefix=nullptr) |
| Writes element norms for a given load/time step to the VTF-file. More... | |
| bool | writeGlvF (const RealFunc &f, const char *fname, int iStep, int &nBlock, const Vector *state=nullptr, int idBlock=50, double time=0.0, const ASMbase *patch=nullptr) |
| Writes a scalar function to the VTF-file. More... | |
| bool | writeGlvStep (int iStep, double value=0.0, int itype=0) |
| Writes load/time step info to the VTF-file. More... | |
| void | closeGlv () |
| Closes the current VTF-file. | |
| VTF * | getVTF () const |
| Returns the current VTF-file object. | |
| void | setVTF (VTF *vtf) |
| Defines the VTF-file for subsequent results output. | |
| int | getStartGeo () const |
| Returns the initial geometry block index. | |
| void | setStartGeo (int gID) |
| Initializes the geometry block counter. | |
| bool | dumpMatlabGrid (std::ostream &os, const std::string &name="IFEM_Mesh", const std::vector< std::string > &sets={}, double scale=1.0) const |
| Dumps the FE model to Matlab format. More... | |
| bool | dumpGeometry (std::ostream &os) const |
| Dumps the (possibly refined) spline geometry in g2-format. More... | |
| void | dumpPrimSol (const Vector &psol, utl::LogStream &os, bool withID=true) const |
| Dumps the primary solution in ASCII format for inspection. More... | |
| bool | dumpSolution (const Vector &psol, utl::LogStream &os) const |
| Dumps the entire solution in ASCII format. More... | |
| bool | dumpResults (const Vector &psol, double time, utl::LogStream &os, bool formatted=false, std::streamsize precision=3) const |
| Dumps solution results at specified points in ASCII format. More... | |
| bool | dumpVector (const Vector &vsol, const char *fname, utl::LogStream &os, std::streamsize precision=3) const |
| Dumps vector solution at specified points in ASCII format. More... | |
| virtual void | dumpMoreResults (double, utl::LogStream &, std::streamsize=3) const |
| Dumps additional problem-specific results in ASCII format. | |
| bool | savePoints (const Vector &psol, double time, int step) const |
| Saves point results to output file for a given time step. More... | |
| bool | saveResults (const Vectors &psol, double time, int step) const |
| Saves result components to output files for a given time step. More... | |
| bool | hasResultPoints () const |
| Checks whether result points have been defined or not. | |
| bool | hasPointResultFile () const |
| Checks whether point result files have been defined or not. | |
| void | setPointResultFile (const std::string &filename, bool dumpCoord=false) |
| Sets the file name for result point output. More... | |
| virtual bool | serialize (std::map< std::string, std::string > &) const |
| Serialization support. | |
| virtual void | printIFforces (const Vector &, RealArray &) |
| Prints out interface force resultants to the log stream. | |
| virtual int | printNRforces (const IntVec &glbNodes={}) const |
| Prints out the nodal reaction forces to the log stream. | |
| virtual bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| virtual bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
Public Member Functions inherited from SIMinput | |
| virtual | ~SIMinput () |
| Empty destructor. | |
| virtual const char ** | getPrioritizedTags () const |
| Returns a list of prioritized XML-tags. | |
| bool | readTopologyOnly (const std::string &fileName) |
| Reads patch topology from the specified input file. More... | |
| int | getUniquePropertyCode (const std::string &setName, int comp=0) |
| Returns a unique integer code for a Property set. More... | |
| size_t | setVecProperty (int code, Property::Type ptype, VecFunc *field=nullptr, int pflag=-1) |
| Defines a vector field property. More... | |
| bool | setTracProperty (int code, Property::Type ptype, TractionFunc *field=nullptr) |
| Defines a traction field property. More... | |
| size_t | setPropertyType (int code, Property::Type ptype, int pindex=-1, char basis=1) |
| Defines the type of a property set. More... | |
| bool | setNeumann (const std::string &prop, const std::string &type, int ndir, int code) |
| Defines a Neumann boundary condition property by parsing a string. More... | |
| std::vector< int > | getFunctionsForElements (const std::vector< int > &elements) |
| Finds the set of basis functions with support on a set of elements. More... | |
| bool | refine (const LR::RefineData &prm) |
| Refines the mesh adaptively. More... | |
| bool | refine (const LR::RefineData &prm, Vector &sol) |
| Refines the mesh adaptively. More... | |
| bool | refine (const LR::RefineData &prm, Vectors &sol) |
| Refines the mesh adaptively. More... | |
| int | refine (const RealFunc &refC, double refTol) |
| Refines the mesh based on a mesh density function. More... | |
| bool | readPatches (std::istream &isp, const char *whiteSpace="") |
| Reads patches from given input stream. More... | |
| bool | addConnection (int mst, int slv, int mIdx, int sIdx, bool coordCheck=false, int dim=1, int thick=1) |
| Connects two patches. More... | |
| const std::vector< ASM::Interface > & | getInterfaces () const |
| Obtain a const reference to model topology. | |
| int | restartBasis (const std::string &restartFile, int restartStep) |
| Handles application restarts by reading a serialized basis. More... | |
| virtual bool | createFEMmodel (char resetNumb='y') |
| Creates the computational FEM model from the spline patches. More... | |
| virtual void | clonePatches (const PatchVec &, const std::map< int, int > &) |
| Creates the computational FEM model by copying the given patches. | |
| virtual bool | hasIC (const std::string &name) const |
| Checks whether a named initial condition is present. | |
| bool | setInitialConditions (SIMdependency *fieldHolder=nullptr) |
| Sets the initial conditions. More... | |
| virtual bool | deSerialize (const SerializeMap &) |
| Deserialization support (for simulation restart). | |
| const TopEntity & | getEntity (const std::string &name) const |
| Returns reference to a named topology entity. | |
| TopEntity & | topology (const std::string &name) |
| Returns access to a named topology entity (for model generators). | |
| const TopologySet & | getTopology () const |
| Returns the whole topology set container (for testing only). | |
| bool | getTopItemNodes (const TopItem &titem, std::vector< int > &glbNodes) const |
| Returns the node numbers associated with a topological item. | |
| IdxVec3 * | getDiscretePoint (int idx) |
| Returns pointer to an indexed discrete point. | |
| virtual std::vector< std::vector< int > > | getElmConnectivities () const |
| Returns the element-to-element connectivities. | |
Public Member Functions inherited from SIMbase | |
| virtual | ~SIMbase () |
| The destructor frees the dynamically allocated objects. | |
| bool | readModel (const char *fileName) |
| Reads model data from the specified input file *fileName. More... | |
| virtual void | initForSingleStep () |
| Interface for app-specific single-step simulation initialisation. | |
| virtual void | initForMultiStep () |
| Interface for app-specific multi-step simulation initialisation. | |
| virtual bool | preprocessC (const IntVec &ignored, bool fixDup, double time0) |
| Performs some pre-processing tasks on the FE model. More... | |
| bool | initSystem (LinAlg::MatrixType mType, size_t nMats=1, size_t nVec=1, size_t nScl=0, bool withRF=false) |
| Allocates the system matrices of the FE problem to be solved. More... | |
| bool | initSystem (const SIMbase *that) |
| Lets this simulator share equation system with that simulator. | |
| void | initLHSbuffers () |
| Initializes left-hand-side element matrix buffers for integrand. | |
| bool | setAssociatedRHS (size_t iMat, size_t iVec) |
| Associates a system vector to a system matrix. More... | |
| bool | setMode (int mode, bool needIntegr=true, bool resetSol=false) |
| Defines the solution mode before the element assembly is started. More... | |
| void | setIntegrationPrm (unsigned short int i, double prm) |
| Initializes an integration parameter for the integrand. More... | |
| void | setQuadratureRule (size_t ng, bool redimBuffers=false, bool printQP=false) |
| Defines the spatial numerical integration scheme to use. More... | |
| virtual bool | printProblem () const |
| Prints out problem-specific data to the log stream. | |
| const 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. | |
| 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 void | registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, char diffBasis=0, int component=1) |
| Registers a dependency on a field from another SIM object. More... | |
| virtual void | registerDependency (SIMdependency *sim, const std::string &name, short int nvc, const PatchVec &patches, const int *MADOF) |
| Registers a dependency on a field from another SIM object. More... | |
| virtual void | registerDependency (SIMdependency *sim, const std::string &name, short int nvc=1) |
| Registers a dependency on a field from another SIM object. More... | |
Public Member Functions inherited from SIMadmin | |
| virtual | ~SIMadmin () |
| Empty destructor. | |
| virtual bool | read (const char *fileName) |
| Reads model data from the specified input file *fileName. | |
| virtual bool | preprocess (const IntVec &ignored={}, bool fixDup=false) |
| Performs some pre-processing tasks on the FE model. | |
| const 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. | |
Protected Member Functions | |
| SIMgeneric (IntegrandBase *itg=nullptr) | |
| Default constructor. | |
| bool | revertSqrt (Vectors &gNorm, Matrix *eNorm) |
| Reverts the square-root operation on some norm quantities. More... | |
Protected Member Functions inherited from SIMoutput | |
| SIMoutput (IntegrandBase *itg) | |
| The constructor just forwards to the base class constructor. | |
| virtual bool | parseOutputTag (const tinyxml2::XMLElement *elem) |
| Parses a subelement of the resultoutput XML-tag. | |
| virtual ElementBlock * | tesselatePatch (size_t pidx) const |
| Tesselates the specified patch. | |
| void | addAddFunc (const std::string &fn, RealFunc *f) |
| Adds a function for additional VTF-file output. More... | |
| virtual bool | writeAddFuncs (int &nBlock, int &idBlock, const Vector &psol, int iStep, double time) |
| Writes out the additional functions to VTF-file. More... | |
| virtual void | preprocessResultPoints () |
| Preprocesses the result sampling points. | |
Protected Member Functions inherited from SIMinput | |
| SIMinput (IntegrandBase *itg) | |
| The constructor just forwards to the base class constructor. | |
| virtual bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
| virtual bool | parseGeometryDimTag (const tinyxml2::XMLElement *elem)=0 |
| Parses a dimension-specific subelement of the geometry XML-tag. | |
| bool | parsePeriodic (const tinyxml2::XMLElement *elem) |
| Parses the periodic XML-tag. More... | |
| FunctionBase * | parseDualTag (const tinyxml2::XMLElement *elem, int ftype=1) |
| Parses the dualfield tag. | |
| int | parseMaterialSet (const tinyxml2::XMLElement *elem, int mindex) |
| Parses the "set" attribute of a material XML-tag. More... | |
| bool | parseTopologySet (const tinyxml2::XMLElement *elem, std::vector< int > &patches) const |
| Parses the "set" attribute of a refine/raiseorder XML-tag. More... | |
| bool | parsePatchList (const tinyxml2::XMLElement *elem, std::vector< int > &patches) const |
| Parses a list of patch indices from an XML-tag. More... | |
| bool | createPropertySet (const std::string &setName, int pc) |
| Creates a set of Property objects. More... | |
| virtual ASMbase * | readPatch (std::istream &isp, int pchInd, const CharVec &unf=CharVec(), const char *whiteSpace="") const =0 |
| Reads a patch from given input stream. More... | |
| virtual bool | readNodes (std::istream &isn, int pchInd, int basis=0, bool oneBased=false) |
| Reads global node data for a patch from given input stream. More... | |
| virtual void | readNodes (std::istream &isn) |
| Reads node numbers from given input stream. More... | |
| virtual ModelGenerator * | getModelGenerator (const tinyxml2::XMLElement *geo) const =0 |
| Instantiates a FEM model generator. More... | |
| virtual bool | connectPatches (const ASM::Interface &ifc, bool coordCheck)=0 |
| Connects two patches. More... | |
| bool | saveBasis (SerializeMap &data) const |
| Writes current basis to a serialization container. More... | |
| bool | restoreBasis (const SerializeMap &data) |
| Restores the basis from a serialization container. More... | |
Protected Member Functions inherited from SIMbase | |
| SIMbase (IntegrandBase *itg) | |
| The constructor initializes the pointers to dynamic data members. | |
| 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. | |
| int | renumberNodes (bool renumMNPC=false) |
| Renumbers the global node numbers after resolving patch topology. More... | |
| virtual bool | renumberNodes (const std::map< int, int > &) |
| Interface for renumbering of app-specific node number tables. | |
| virtual bool | extractPatchSolution (IntegrandBase *problem, const Vectors &sol, size_t pindx) const |
| Extracts all local solution vector(s) for a specified patch. More... | |
| char | getMDflag () const |
| Returns the multi-dimension simulator sequence flag. | |
| virtual void | shiftGlobalNums (int, int) |
| Shifts global node and element numbers by constant offsets. | |
| virtual bool | initMaterial (size_t) |
| Initializes material properties for integration of interior terms. | |
| virtual bool | initBodyLoad (size_t) |
| Initializes the body load properties for current patch. | |
| virtual bool | initNeumann (size_t) |
| Initializes for integration of Neumann terms for a given property. | |
| virtual bool | assembleDiscreteTerms (const IntegrandBase *, const TimeDomain &) |
| Assembles problem-dependent discrete terms, if any. | |
| virtual bool | assembleDiscreteItems (const IntegrandBase *itg, const TimeDomain &time, const Vectors &) |
| Assembles problem-dependent discrete terms, if any. More... | |
| virtual double | externalEnergy (const Vectors &psol, const TimeDomain &) const |
| Computes (possibly problem-dependent) external energy contribution. | |
| virtual bool | postProcessNorms (Vectors &, Matrix *) |
| Applies app-specific post-processing on norms. | |
| void | generateThreadGroups (const Property &p, bool silence=false) |
| Generates element groups for multi-threading of boundary integrals. More... | |
| void | changeNumThreads () |
| Called if number of threads changes. | |
| bool | addMADOF (unsigned char basis, unsigned char nndof, bool other=true) |
| Adds a MADOF with an extraordinary number of DOFs on a given basis. More... | |
| double * | theExtEnerg () |
| Returns a pointer to the external energy path integral value. | |
| const double * | getExtEnerg () const |
| Returns a const pointer to the external energy path integral value. | |
Protected Member Functions inherited from SIMadmin | |
| SIMadmin (const char *heading=nullptr) | |
| The default constructor initializes the process administrator. | |
| SIMadmin (SIMadmin &anotherSIM) | |
| Copy constructor. | |
Protected Member Functions inherited from XMLInputBase | |
| const tinyxml2::XMLElement * | loadFile (tinyxml2::XMLDocument &doc, const char *fileName, bool verbose=false) |
| Loads an XML input file into a tinyxml2::XMLDocument object. More... | |
Protected Member Functions inherited from SIMdependency | |
| SIMdependency () | |
| The constructor is protected to allow sub-class instances only. | |
| bool | extractPatchDependencies (IntegrandBase *problem, const PatchVec &model, size_t pindx) const |
| Extracts local solution vector(s) for all dependent fields. More... | |
Additional Inherited Members | |
Public Types inherited from SIMinput | |
| typedef std::vector< ICInfo > | InitialCondVec |
| Convenience declaration. | |
| typedef std::vector< unsigned char > | CharVec |
| Convenience declaration. | |
| typedef std::pair< int, Vec3 > | IdxVec3 |
| Convenience declaration. | |
Public Types inherited from SIMdependency | |
| typedef std::vector< ASMbase * > | PatchVec |
| Spline patch container. | |
Public Attributes inherited from SIMadmin | |
| SIMoptions & | opt |
| Simulation control parameters. | |
Static Public Attributes inherited from SIMbase | |
| static bool | ignoreDirichlet = false |
| Set to true for free vibration analysis. | |
| static bool | preserveNOrder = false |
| Set to true to preserve node ordering. | |
Static Public Attributes inherited from SIMadmin | |
| static int | msgLevel = 2 |
| Controls the console output amount during solving. | |
Protected Types inherited from SIMoutput | |
| using | ResPointVec = std::vector< ResultPoint > |
| Result point container. | |
| using | ResPtPair = std::pair< std::string, ResPointVec > |
| File name to result point group mapping. | |
Protected Types inherited from SIMinput | |
| typedef std::map< std::string, std::string > | SerializeMap |
| Convenience type. | |
Protected Types inherited from SIMbase | |
| typedef std::map< int, RealFunc * > | SclFuncMap |
| Scalar field container. | |
| typedef std::map< int, VecFunc * > | VecFuncMap |
| Vector field container. | |
| typedef std::map< int, TractionFunc * > | TracFuncMap |
| Traction field container. | |
| typedef std::multimap< int, IntegrandBase * > | IntegrandMap |
| Property code to integrand map. | |
Protected Types inherited from SIMadmin | |
| using | IntVec = std::vector< int > |
| Convenience alias. | |
Static Protected Member Functions inherited from SIMinput | |
| static std::istream * | getPatchStream (const char *tag, const char *patch) |
| Helper method returning a stream for patch geometry input. More... | |
Protected Attributes inherited from SIMoutput | |
| std::map< int, int > | addDisBlk |
| Additional displacement block mapping. | |
| std::vector< ResPtPair > | myPoints |
| User-defined result sampling points. | |
Protected Attributes inherited from SIMinput | |
| ModelGenerator * | myGen |
| Model generator. | |
| TopologySet | myEntitys |
| Set of named topological entities. | |
| std::vector< IdxVec3 > | myTopPts |
| Discrete points not belonging to any patch. | |
| std::vector< ASM::Interface > | myInterfaces |
| Topology interface descriptions. | |
| std::map< std::string, InitialCondVec > | myICs |
| Initial condition definitions. | |
Protected Attributes inherited from SIMbase | |
| unsigned char | nsd |
| Number of spatial dimensions. | |
| PatchVec | myModel |
| The actual NURBS/spline model. | |
| PropertyVec | myProps |
| Physical property mapping. | |
| SclFuncMap | myScalars |
| Scalar property fields. | |
| VecFuncMap | myVectors |
| Vector property fields. | |
| TracFuncMap | myTracs |
| Traction property fields. | |
| 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. | |
Generic SIM class with some added functionalities.
This class extends the SIMbase class with some added functionalities of generic character, which can be used to access the FE data and structures in a more flexible way.
| ASMbase * SIMgeneric::createDefaultModel | ( | ) |
Creates a model with the default geometry (line, plane, cube).
References ModelGenerator::createGeometry(), SIMinput::getModelGenerator(), SIMbase::myModel, and SIMbase::nGlPatches.
| int SIMgeneric::evalPoint | ( | const double * | xi, |
| Vec3 & | X, | ||
| double * | param = nullptr, |
||
| int | patch = 1, |
||
| bool | global = false |
||
| ) | const |
Evaluates the mapping of the geometry at the given point.
| [in] | xi | Dimensionless parameters in range [0,1] of the point |
| [out] | X | The Cartesian coordinates of the point |
| [out] | param | The parameters of the point in the knot-span domain |
| [in] | patch | 1-based patch index containing the evaluation point |
| [in] | global | If true, return global number, otherwise patch-local |
References ASMbase::evalPoint(), ASMbase::getNodeID(), and SIMbase::getPatch().
| int SIMgeneric::findElementContaining | ( | const double * | param, |
| int | patch = 1, |
||
| bool | global = false |
||
| ) | const |
Returns the element that contains a specified spatial point.
| [in] | param | The parameters of the point in the knot-span domain |
| [in] | patch | 1-based patch index containing the point |
| [in] | global | If true, return global number, otherwise patch-local |
References ASMbase::findElementContaining(), ASMbase::getElmID(), and SIMbase::getPatch().
|
virtual |
Returns the global effectivity index.
| [in] | gNorm | Global norm values |
| [in] | idx | 0-based norm group index |
| [in] | inorm | 1-based norm index within the specified norm group |
Implements SIMoutput.
| RealArray SIMgeneric::getInterfaceForces | ( | const RealArray & | sf, |
| const RealArray & | weights, | ||
| int | code | ||
| ) | const |
Extracts the force resultant on a specified interface.
| [in] | sf | Internal nodal forces |
| [in] | weights | Nodal weights |
| [in] | code | Code indentifying the interface to extract forces for |
References SIMbase::getBoundaryNodes(), SAM::getNodeDOFs(), SIMbase::mySam, and SIMbase::nsd.
|
virtual |
Returns the reference norm to base mesh adaptation upon.
| [in] | gNorm | Global norm values |
| [in] | adaptor | 0-based norm group index to be used for mesh adaptation |
Implements SIMoutput.
References utl::vector< T >::size().
| RealArray SIMgeneric::getSolution | ( | const Vector & | psol, |
| const double * | par, | ||
| int | deriv = 0, |
||
| int | patch = 1 |
||
| ) | const |
Evaluates the primary solution at the given point.
| [in] | psol | Primary solution vector |
| [in] | par | Parameters of the point to evaluate at |
| [in] | deriv | Derivative order of the solution |
| [in] | patch | 1-based patch index containing the evaluation point |
References SIMoptions::discretization, utl::vector< T >::empty(), SIMbase::getPatch(), and SIMadmin::opt.
Referenced by SIM3D::getSolution(), SIM2D::getSolution(), and SIM1D::getSolution().
|
virtual |
Prints integrated solution norms to the log stream.
| [in] | gNorm | Global norm values |
| [in] | w | Total number of characters in the norm labels |
Implements SIMoutput.
References utl::adjustRight(), IFEM::cout, NormBase::getName(), SIMbase::getNormIntegrand(), getVCPindex(), SIMbase::haveAnaSol(), SIMadmin::opt, printNormGroup(), SIMoptions::project, and utl::vector< T >::size().
Reverts the square-root operation on some norm quantities.
| gNorm | Global norm values |
| eNorm | Element norm values |
This method is used to fix the problem that all norm quantities (global and on element level) will be subjected to a final square-root operation after they have been integrated and accumulated, through NormBase::applyFinalOp(). However, a few quantities (like the volume and variationally consistent postprocessing values) should not reveive this operation.
References utl::matrix< T >::cols(), SIMbase::extrFunc, getVCPindex(), getVolumeIndex(), SIMbase::haveAnaSol(), and utl::matrix< T >::rows().