|
IFEM
90A354
|
Sub-class with additional functionality for result output. More...
#include <SIMoutput.h>


Classes | |
| struct | ResultPoint |
| Struct defining a result sampling point. More... | |
Public Member Functions | |
| 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 double | getReferenceNorm (const Vectors &, size_t) const =0 |
| Returns the reference norm to base mesh adaptation upon. | |
| virtual double | getEffectivityIndex (const Vectors &, size_t, size_t) const =0 |
| Returns the global effectivity index. | |
| virtual void | printNorms (const Vectors &, size_t=36) const =0 |
| Prints integrated solution norms to the log stream. | |
| 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 Types | |
| 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. | |
Protected Member Functions | |
| 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... | |
Protected Attributes | |
| 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. | |
Private Member Functions | |
| bool | initPatchForEvaluation (int patchNo) const |
| Private helper to initialize patch for solution evaluation. | |
| bool | extractNodeVec (const RealArray &glbVec, Vector &locVec, const ASMbase *patch, int nodalCmps, bool &emptyPatches) const |
| Private helper to extract patch-level solution vectors. | |
| bool | writeScalarFields (const Matrix &field, int geomID, int &nBlock, std::vector< IntVec > &sID, size_t *nScl=nullptr, ASM::ResultClass resClass=ASM::PRIMARY) |
| Private helper to write out scalar fields to VTF-file. | |
| void | preprocessResPtGroup (std::string &ptFile, ResPointVec &points) |
| Preprocesses a result sampling point group. More... | |
| bool | dumpResults (const Vector &psol, double time, utl::LogStream &os, const ResPointVec &gPoints, bool formatted, std::streamsize precision) const |
| Dumps solution results at the given points in ASCII format. More... | |
| bool | evalResults (const Vectors &psol, const ResPointVec &gPoints, const ASMbase *patch, IntVec &points, IntVec &elms, Vec3Vec &Xp, Matrix &sol1, Matrix &sol2, std::vector< std::string > *compNames=nullptr) const |
| Evaluates solution results at specified points for a given patch. More... | |
Private Attributes | |
| std::map< std::string, RealFunc * > | myAddScalars |
| Scalar functions to output. | |
| std::set< std::string > | wantComps |
| Component names for grid output. | |
| int | myPrec |
| Output precision for result sampling. | |
| double | myPtSize |
| Size of result point visualization in VTF-file. | |
| int | myGeomID |
| Geometry block ID for the first patch in the VTF-file. | |
| int | myGeofs1 |
| ID offset for immersed geometry block in the VTF-file. | |
| int | myGeofs2 |
| ID offset for extra geometry block in the VTF-file. | |
| VTF * | myVtf |
| VTF-file for result visualization. | |
| bool | mergeVtf |
| If true, merge multi-patches into one on the VTF-file. | |
| bool | logRpMap |
| If true, print out the result point mapping. | |
| int | idxGrid |
| Index into myPoints for grid result output. | |
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. | |
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... | |
Sub-class with additional functionality for result output.
This class extends the SIMbase class with some added functionalities for dumping simulation results to VTF and ASCII files, and terminal printout. These items are put in a separate sub-class to hide them from the SIMbase class, which contains the main simulation driver.
|
inlineprotected |
Adds a function for additional VTF-file output.
| [in] | fn | Function name (appears as the scalar name in the VTF-file) |
| [in] | f | Pointer to a scalar-valued spatial function. |
References myAddScalars.
Referenced by SIM2D::parseGeometryTag().
| bool SIMoutput::dumpGeometry | ( | std::ostream & | os | ) | const |
Dumps the (possibly refined) spline geometry in g2-format.
| os | Output stream to write the geometry data to |
References SIMbase::myModel.
Referenced by AdaptiveSetup::writeMesh().
| bool SIMoutput::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.
| os | Output stream to write the grid data to | |
| [in] | name | Name of the Matlab function returning the grid |
| [in] | sets | Names of nodal sets to be printed out in addition |
| [in] | scale | Scaling factor |
References SIMbase::getElmNodes(), SIMbase::getNodeCoord(), SIMbase::getNoElms(), SIMbase::getNoNodes(), SIMbase::getPatch(), TopItem::idim, TopItem::item, SIMinput::myEntitys, SIMbase::nsd, and TopItem::patch.
| void SIMoutput::dumpPrimSol | ( | const Vector & | psol, |
| utl::LogStream & | os, | ||
| bool | withID = true |
||
| ) | const |
Dumps the primary solution in ASCII format for inspection.
| [in] | psol | Primary solution vector |
| os | Output stream to write the solution data to | |
| [in] | withID | If true, write node ID and coordinates too |
References utl::vector< T >::empty(), utl::LogStream::flush(), SAM::getMADOF(), SIMbase::myModel, SIMbase::mySam, and utl::trunc().
Referenced by MultiStepSIM::dumpStep().
| bool SIMoutput::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.
| [in] | psol | Primary solution vector to derive other quantities from |
| [in] | time | Load/time step parameter |
| os | Output stream to write the solution data to | |
| [in] | formatted | If false, write all result points on a single line without point identifications, but with time as first column |
| [in] | precision | Number of digits after the decimal point |
References utl::vector< T >::empty(), idxGrid, IntegrandBase::initResultPoints(), myPoints, and SIMbase::myProblem.
Referenced by MultiStepSIM::dumpResults(), NewmarkSIM::dumpResults(), savePoints(), and AdaptiveSIM::solveStep().
|
private |
Dumps solution results at the given points in ASCII format.
| [in] | psol | Primary solution vector to derive other quantities from |
| [in] | time | Load/time step parameter |
| os | Output stream to write the solution data to | |
| [in] | gPoints | Group of result points to write solution data for |
| [in] | formatted | If false, write all result points on a single line without point identifications, but with time as first column |
| [in] | precision | Number of digits after the decimal point |
References SIMadmin::adm, ProcessAdm::dd, utl::vector< T >::empty(), utl::matrixBase< T >::empty(), evalResults(), utl::LogStream::flags(), IntegrandBase::getNo2ndSolPerLine(), SAM::getNodalReactions(), IntegrandBase::getNoSolutions(), SIMbase::getNoSpaceDim(), ProcessAdm::getProcId(), SIMbase::getReactionForces(), AnaSol::getScalarSecSol(), AnaSol::getScalarSol(), AnaSol::getStressSol(), AnaSol::getVectorSecSol(), AnaSol::getVectorSol(), DomainDecomposition::isPartitioned(), SIMbase::myModel, SIMbase::myProblem, SIMbase::mySam, SIMbase::mySol, utl::LogStream::precision(), utl::matrix< T >::rows(), utl::trunc(), and Vec3::x.
| bool SIMoutput::dumpSolution | ( | const Vector & | psol, |
| utl::LogStream & | os | ||
| ) | const |
Dumps the entire solution in ASCII format.
| [in] | psol | Primary solution vector to derive other quantities from |
| os | Output stream to write the solution data to |
References utl::matrix< T >::cols(), utl::vector< T >::empty(), IntegrandBase::getField1Name(), IntegrandBase::getField2Name(), SAM::getMADOF(), SAM::getNodeDOFs(), IntegrandBase::getSolution(), initPatchForEvaluation(), SIMbase::myModel, SIMbase::myProblem, SIMbase::mySam, utl::matrix< T >::rows(), and utl::trunc().
| bool SIMoutput::dumpVector | ( | const Vector & | vsol, |
| const char * | fname, | ||
| utl::LogStream & | os, | ||
| std::streamsize | precision = 3 |
||
| ) | const |
Dumps vector solution at specified points in ASCII format.
| [in] | vsol | Solution vector |
| [in] | fname | Name of vector field |
| os | Output stream to write the solution data to | |
| [in] | precision | Number of digits after the decimal point |
References SIMoptions::discretization, utl::vector< T >::empty(), utl::LogStream::flags(), SAM::getMADOF(), SIMbase::getNoFields(), SIMbase::getNoNodes(), idxGrid, SIMoutput::ResultPoint::inod, SIMbase::myModel, myPoints, SIMbase::mySam, SIMadmin::opt, SIMoutput::ResultPoint::patch, utl::LogStream::precision(), utl::matrix< T >::rows(), utl::vector< T >::size(), utl::trunc(), and SIMoutput::ResultPoint::u.
Referenced by NewmarkSIM::dumpResults().
| bool SIMoutput::eval2ndSolution | ( | const Vector & | psol, |
| double | time, | ||
| int | psolComps = 0 |
||
| ) |
Evaluates the secondary solution for a given load/time step.
| [in] | psol | Primary solution vector |
| [in] | time | Load/time step parameter |
| [in] | psolComps | Optional number of primary solution components |
This method only evaluates the solutions fields, and does not return any data. It is used only for load/time steps that are not saved when the solution has to be evaluated at every increment in any case to ensure consistency (e.g., when material models with history variables are in use).
References utl::vector< T >::empty(), extractNodeVec(), IntegrandBase::getNoFields(), IntegrandBase::getNoSolutions(), IntegrandBase::getSolution(), initPatchForEvaluation(), IntegrandBase::initResultPoints(), SIMbase::myModel, SIMbase::myProblem, myVtf, SIMoptions::nViz, SIMadmin::opt, and SIMoptions::pSolOnly.
|
private |
Evaluates solution results at specified points for a given patch.
| [in] | psol | Primary solution vectors to derive other quantities from |
| [in] | gPoints | Result point definitions |
| [in] | patch | The patch to evaluate result points for |
| [out] | points | List of result points within this patch |
| [out] | elms | List of element center points within this patch |
| [out] | Xp | Coordinates of result points within this patch |
| [out] | sol1 | Matrix of primary solution values at result points |
| [out] | sol2 | Matrix of secondary solution values at result points |
| [out] | compNames | Names of solution components in sol1 and sol2 |
References utl::matrix< T >::augmentCols(), utl::matrix< T >::augmentRows(), SIMoptions::discretization, utl::matrixBase< T >::empty(), ASMbase::empty(), ASMbase::evalSolution(), ASMbase::extractNodalVec(), IntegrandBase::getField1Name(), IntegrandBase::getField2Name(), SAM::getMADOF(), IntegrandBase::getNoFields(), ASMbase::getNoNodes(), ASMbase::getSolution(), IntegrandBase::getSolution(), ASMbase::idx, initPatchForEvaluation(), SIMbase::myProblem, SIMbase::mySam, SIMbase::mySol, SIMadmin::opt, IntegrandBase::primaryScalarFields(), and utl::matrix< T >::rows().
Referenced by dumpResults(), and saveResults().
| bool SIMoutput::getElementSet | ( | int | iset, |
| std::string & | name, | ||
| RealArray & | elSet | ||
| ) | const |
Retrieves the specified element set as a scalar field.
| [in] | iset | 1-based index of the element set to retrieve |
| [out] | name | Name of the retrieved element set |
| [out] | elSet | 1-based element index array indicating the set members |
This method returns an array of length equal to the total number of elements in the model, containing either 1.0 or 0.0 depending on whether the element identified by the corresponding array index is in the set iset or not. This array can then be used as a scalar field to visualize the element set, using the writeGlvE() method.
References SIMbase::getNoElms(), and SIMbase::myModel.
Referenced by writeGlvNo().
|
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 from SIMbase.
References IFEM::cout, SIMbase::getPatch(), SIMoutput::ResultPoint::inod, SIMbase::merge(), myPoints, and SIMoutput::ResultPoint::patch.
| bool SIMinput::parse |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
Referenced by SIM1D::parse(), SIM2D::parse(), SIM3D::parse(), and SIMsupel::parse().
|
virtual |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
Reimplemented from SIMinput.
Reimplemented in SIM3D, SIM2D, and SIM1D.
References IFEM::cout, myPoints, SIMinput::parse(), SIMoutput::ResultPoint::patch, utl::readLine(), setPointResultFile(), and SIMoutput::ResultPoint::u.
Referenced by NonLinSIM::parse(), AdaptiveSetup::parse(), EigenModeSIM::parse(), and NewmarkSIM::parse().
| bool SIMinput::parse |
Parses a data section from an XML document.
| [in] | elem | The XML element to parse |
|
private |
Preprocesses a result sampling point group.
| ptFile | Name of file that these result points are dumped to |
| points | Group of result points that are dumped to the given file |
References IFEM::cout, ASMbase::empty(), ASMbase::getElmID(), ASMbase::getNodeID(), SIMbase::getPatch(), logRpMap, SIMadmin::msgLevel, SIMbase::myModel, SIMbase::myProblem, SIMbase::nsd, and ASMbase::printElmInfo().
Referenced by preprocessResultPoints().
| bool SIMoutput::savePoints | ( | const Vector & | psol, |
| double | time, | ||
| int | step | ||
| ) | const |
Saves point results to output file for a given time step.
| [in] | psol | Primary solution vector |
| [in] | time | Load/time step parameter |
| [in] | step | Load/time step counter |
References dumpResults(), utl::vector< T >::empty(), SIMbase::getLocalPatchIndex(), idxGrid, IntegrandBase::initResultPoints(), myPoints, myPrec, SIMbase::myProblem, and SIMoutput::ResultPoint::patch.
Referenced by MultiStepSIM::savePoints(), and AdaptiveSIM::savePoints().
| bool SIMoutput::saveResults | ( | const Vectors & | psol, |
| double | time, | ||
| int | step | ||
| ) | const |
Saves result components to output files for a given time step.
| [in] | psol | Primary solution vectors |
| [in] | time | Load/time step parameter |
| [in] | step | Load/time step counter |
References utl::matrix< T >::augmentRows(), utl::matrix< T >::cols(), utl::matrixBase< T >::empty(), evalResults(), IntegrandBase::getNoSolutions(), idxGrid, IntegrandBase::initResultPoints(), SIMbase::myModel, myPoints, SIMbase::myProblem, utl::matrix< T >::rows(), and wantComps.
| void SIMoutput::setPointResultFile | ( | const std::string & | filename, |
| bool | dumpCoord = false |
||
| ) |
Sets the file name for result point output.
| [in] | filename | The file name prefix (optionally with extension) |
| [in] | dumpCoord | If true, write point coordinates to separate file |
References IFEM::cout, SIMbase::myPatches, SIMadmin::myPid, myPoints, and SIMadmin::nProc.
Referenced by parse().
|
protectedvirtual |
Writes out the additional functions to VTF-file.
| nBlock | Running result block counter | |
| idBlock | Running scalar identification block numbering | |
| [in] | psol | Primary solution vector (for state-dependent functions) |
| [in] | iStep | Load/time step identifier |
| [in] | time | Load/time step parameter |
References utl::vector< T >::empty(), myAddScalars, and writeGlvF().
Referenced by writeGlvS().
| bool SIMoutput::writeGlvBC | ( | int & | nBlock, |
| int | iStep = 1 |
||
| ) | const |
Writes boundary conditions as scalar fields to the VTF-file.
| nBlock | Running result block counter | |
| [in] | iStep | Load/time step identifier |
References utl::matrix< T >::cols(), IFEM::cout, SIMoptions::discretization, utl::matrix< T >::getRow(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, myVtf, SIMoptions::nViz, SIMadmin::opt, VTF::writeNres(), and VTF::writeSblk().
Referenced by AdaptiveSIM::writeGlv().
| bool SIMoutput::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.
| [in] | field | The element field to output |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | name | Name of field |
| [in] | idBlock | Starting value of result block numbering |
| [in] | internalOrder | If true, the data in field are assumed to be ordered w.r.t. the internal element ordering |
If field is empty, the patch-level external element numbers will instead define the scalar field to be written.
References IFEM::cout, utl::vector< T >::empty(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, myVtf, utl::vector< T >::norm2(), VTF::writeEres(), and VTF::writeSblk().
Referenced by writeGlvNo().
| bool SIMoutput::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.
| [in] | f | The function to output |
| [in] | fname | Name of the function |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | state | Optional state vector (for state-dependent functions) |
| [in] | idBlock | Starting value of result block numbering |
| [in] | time | Load/time step parameter |
| [in] | patch | If specified, only evalulate for this patch |
References IFEM::cout, utl::matrix< T >::expandRows(), extractNodeVec(), VTF::getBlock(), Integrand::getIntegrandType(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, SIMbase::myProblem, myVtf, SIMoptions::nViz, SIMadmin::opt, Integrand::PIOLA_MAPPING, utl::matrixBase< T >::ptr(), utl::matrix< T >::rows(), VTF::writeNfunc(), and VTF::writeSblk().
Referenced by writeAddFuncs().
|
virtual |
Writes current model geometry to the VTF-file.
| nBlock | Running result block counter | |
| [in] | inpFile | File name used to construct the VTF-file name from |
| [in] | doClear | If true, clear geometry block if inpFile is null |
The spline patches are tesselated into linear finite elements with a fixed number of elements within each knot-span of non-zero length. The solution fields are then evaluated at the nodal points of the generated FE mesh and written to the VTF-file as vector and scalar fields by the other writeGlv* methods.
References SIMadmin::adm, IFEM::cout, ProcessAdm::dd, SIMoptions::format, ProcessAdm::getProcId(), DomainDecomposition::isPartitioned(), SIMadmin::myPid, myVtf, SIMadmin::nProc, SIMadmin::opt, and SIMoptions::vtf.
Referenced by AdaptiveSIM::solveStep(), and AdaptiveSIM::writeGlv().
| bool SIMoutput::writeGlvG | ( | int & | nBlock, |
| double | time | ||
| ) |
Writes current model geometry to the currently open VTF-file.
| nBlock | Running result block counter | |
| [in] | time | The time from which this (new) geometry applies, in case of time-evolution. If negative, the current geometry is appended to the already existing geometry blocks. |
When time > 0 and there already exist some geometry blocks in the VTF, this method assumes that the new geometry blocks are based on the same set of nodes such that new node blocks are not required to be written.
References VTF::clearGeometryBlocks(), IFEM::cout, VTF::getBlock(), VTF::getNodeBlock(), ElementBlock::getNoNodes(), ElementBlock::merge(), mergeVtf, SIMadmin::msgLevel, myGeofs1, myGeofs2, SIMbase::myModel, myPoints, myPtSize, SIMinput::myTopPts, myVtf, ElementBlock::removeElement(), tesselatePatch(), VTF::writeGrid(), and SIMoutput::ResultPoint::X.
| bool SIMoutput::writeGlvM | ( | const Mode & | mode, |
| bool | freq, | ||
| int & | nBlock | ||
| ) |
Writes a mode shape to the VTF-file.
| [in] | mode | The mode shape eigenvector and associated eigenvalue |
| [in] | freq | true if the eigenvalue is a frequency |
| nBlock | Running result block counter |
The eigenvalue is used as a label on the step state info.
References IFEM::cout, Mode::eigNo, Mode::eigVal, Mode::eigVec, utl::vector< T >::empty(), extractNodeVec(), mergeVtf, SIMadmin::msgLevel, myGeofs1, myGeofs2, myGeomID, SIMbase::myModel, myVtf, SIMoptions::nViz, SIMadmin::opt, VTF::writeDblk(), VTF::writeState(), and VTF::writeVres().
| bool SIMoutput::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.
| [in] | norms | The element norms to output |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | prefix | Prefices for projected solutions |
| [in] | idBlock | Starting value of result block numbering |
| [in] | dualPrefix | Prefix for dual solution norms |
If dualPrefix is not null, it is assumed that the norms were computed from the dual solution and therefore labelled as such. In addition to the norms, also the SIMbase::dualField function value is written as a scalar field to the VTF-file in that case. This function is then evaluated at the centre of each visualization element since it typically is a discontinuous function.
References utl::matrix< T >::cols(), IFEM::cout, SIMbase::dualField, utl::matrixBase< T >::empty(), utl::matrix< T >::fillColumn(), VTF::getBlock(), ElementBlock::getCenter(), utl::matrix< T >::getColumn(), ElementBlock::getElmId(), NormBase::getName(), ElementBlock::getNoElms(), NormBase::getNoFields(), IntegrandBase::getNormIntegrand(), utl::matrix< T >::getRow(), FunctionBase::getScalarValue(), NormBase::hasElementContributions(), FunctionBase::initPatch(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, SIMbase::myProblem, SIMbase::mySol, myVtf, utl::matrix< T >::resize(), utl::matrix< T >::rows(), VTF::writeEres(), and VTF::writeSblk().
Referenced by AdaptiveSIM::writeGlv().
| bool SIMoutput::writeGlvNo | ( | int & | nBlock, |
| int & | idBlock, | ||
| int | maxBlock = 20, |
||
| int | iStep = 1 |
||
| ) | const |
Writes global node numbers as scalar fields to the VTF-file.
| nBlock | Running result block counter | |
| idBlock | Result block ID number | |
| [in] | maxBlock | Highest block ID number |
| [in] | iStep | Load/time step identifier |
If you have a complex model with lots of nodal points, this might be used as a tool to identify the location of the nodes by visualizing their global number and the original node numbers.
References utl::vector< T >::begin(), utl::vector< T >::clear(), utl::vector< T >::end(), utl::vector< T >::fill(), getElementSet(), SIMbase::getNoElms(), SIMbase::getNoNodes(), SIMbase::myDegenElm, SIMbase::myDupNodes, SIMbase::myLoc2Glb, utl::vector< T >::push_back(), writeGlvE(), and writeGlvS().
| bool SIMoutput::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.
| [in] | ssol | Secondary solution vector (control point values) |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | idBlock | Starting value of result block numbering |
| [in] | prefix | Common prefix for the field components |
| [in] | maxVal | Optional array of maximum values |
If iStep is zero (or negative), this method only evaluates the projected solution at the visualization points and updates the maxVal array, without writing data to the VTF-file.
References utl::vector< T >::begin(), IFEM::cout, SIMbase::extractPatchSolution(), SIMbase::fieldProjections(), VTF::getBlock(), ElementBlock::getCoord(), IntegrandBase::getField2Name(), IntegrandBase::getNoFields(), SIMbase::getNoNodes(), utl::matrix< T >::getRow(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, SIMbase::myProblem, myVtf, SIMoptions::nViz, SIMadmin::opt, utl::matrix< T >::rows(), VTF::writeSblk(), and writeScalarFields().
Referenced by AdaptiveSIM::writeGlv().
| bool SIMoutput::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.
| [in] | psol | Primary solution vector |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | time | Load/time step parameter |
| [in] | pvecName | Optional name of the primary vector field solution |
| [in] | idBlock | Starting value of result block numbering |
| [in] | psolComps | Optional number of primary solution components |
References writeAddFuncs(), writeGlvS1(), and writeGlvS2().
| bool SIMoutput::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.
| [in] | scl | The scalar field to output (nodal values) |
| [in] | fieldName | Name identifying the scalar field |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | idBlock | Result block ID number |
This method assumes the scalar field is attached to the first basis if we are using a mixed basis.
References IFEM::cout, utl::vector< T >::empty(), SIMbase::extractPatchSolution(), Integrand::getIntegrandType(), SIMbase::getNoNodes(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, SIMbase::myProblem, myVtf, SIMoptions::nViz, SIMadmin::opt, Integrand::PIOLA_MAPPING, utl::vector< T >::size(), VTF::writeNres(), and VTF::writeSblk().
Referenced by MultiStepSIM::saveStep(), AdaptiveSIM::writeGlv(), and writeGlvNo().
|
virtual |
Writes primary solution for a given load/time step to the VTF-file.
| [in] | psol | Primary solution vector |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | time | Load/time step parameter |
| [in] | pvecName | Optional name of the primary vector field solution |
| [in] | idBlock | Starting value of result block numbering |
| [in] | psolComps | Optional number of primary solution components |
| [in] | scalarOnly | If true, write vector as scalar components only |
This method writes only the primary solution field to the VTF-file. If analytical solution fields are available, those fields are written as well.
The way the solution is written depends on whether it is a scalar or vector field, and on the input parameters pvecName and psolComps, as follows:
The scalar field components are labelled pvecName_(i) where (i) is in (x,y,z,rx,ry,rz), if pvecName is not null and psolComps is positive or the myProblem member is null. Otherwise, their names are obtained by invoking the method IntegrandBase::getField1Name() of the myProblem member prefixed by pVecName, if the latter is not null and psolComps is negative.
References addDisBlk, utl::matrix< T >::augmentCols(), ElementBlock::begin_XYZ(), IFEM::cout, FunctionBase::dim(), utl::vector< T >::empty(), utl::matrixBase< T >::empty(), ElementBlock::end_XYZ(), extractNodeVec(), utl::matrix< T >::fill(), utl::matrix< T >::fillColumn(), VTF::getBlock(), IntegrandBase::getField1Name(), Integrand::getIntegrandType(), SIMbase::getNoFields(), IntegrandBase::getNoFields(), SIMbase::getNoSpaceDim(), ElementBlock::getParam(), AnaSol::getScalarSol(), AnaSol::getVectorSol(), AnaSol::initPatch(), mergeVtf, SIMadmin::msgLevel, myGeofs1, myGeofs2, myGeomID, SIMbase::myModel, SIMbase::myProblem, SIMbase::mySol, myVtf, SIMoptions::nViz, SIMadmin::opt, Integrand::PIOLA_MAPPING, IntegrandBase::primaryScalarFields(), utl::matrix< T >::rows(), VTF::writeDblk(), VTF::writeSblk(), writeScalarFields(), VTF::writeVblk(), and VTF::writeVres().
Referenced by NewmarkSIM::saveStep(), AdaptiveSIM::writeGlv(), and writeGlvS().
|
virtual |
Writes secondary solution for a load/time step to the VTF-file.
| [in] | psol | Primary solution vector |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | time | Load/time step parameter |
| [in] | idBlock | Starting value of result block numbering |
| [in] | psolComps | Optional number of primary solution components |
This method writes only the secondary solution fields to the VTF-file. If analytical solution fields are available, those fields are written as well.
References utl::matrix< T >::augmentCols(), ElementBlock::begin_XYZ(), IFEM::cout, SIMoptions::discretization, utl::vector< T >::empty(), utl::matrixBase< T >::empty(), ElementBlock::end_XYZ(), IntegrandBase::evalSol(), extractNodeVec(), VTF::getBlock(), IntegrandBase::getField2Name(), SIMbase::getNoFields(), IntegrandBase::getNoFields(), IntegrandBase::getNoSolutions(), ElementBlock::getParam(), IntegrandBase::getPrincipalDir(), AnaSol::getScalarSecSol(), IntegrandBase::getSolution(), AnaSol::getStressSol(), AnaSol::getVectorSecSol(), AnaSol::hasScalarSol(), AnaSol::hasVectorSol(), AnaSol::initPatch(), initPatchForEvaluation(), IntegrandBase::initResultPoints(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, SIMbase::myProblem, SIMbase::mySol, myVtf, SIMoptions::nViz, SIMadmin::opt, SIMoptions::project, SIMoptions::pSolOnly, VTF::writeSblk(), writeScalarFields(), VTF::writeVblk(), and VTF::writeVres().
Referenced by writeGlvS().
| bool SIMoutput::writeGlvStep | ( | int | iStep, |
| double | value = 0.0, |
||
| int | itype = 0 |
||
| ) |
Writes load/time step info to the VTF-file.
| [in] | iStep | Load/time step identifier |
| [in] | value | Load parameter or time of the step |
| [in] | itype | Type identifier of the step |
References myVtf, VTF::writeGeometryBlocks(), and VTF::writeState().
Referenced by MultiStepSIM::saveStep(), AdaptiveSIM::solveStep(), and AdaptiveSIM::writeGlv().
| bool SIMoutput::writeGlvT | ( | int | iStep, |
| int & | geoBlk, | ||
| int & | nBlock | ||
| ) | const |
Writes boundary tractions for a given time step to the VTF-file.
| [in] | iStep | Load/time step identifier |
| geoBlk | Running geometry block counter | |
| nBlock | Running result block counter |
References IFEM::cout, IntegrandBase::hasTractionValues(), SIMadmin::msgLevel, SIMbase::myProblem, myVtf, and IntegrandBase::writeGlvT().
Referenced by MultiStepSIM::saveStep(), and AdaptiveSIM::writeGlv().
| bool SIMoutput::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.
| [in] | vec | The vector field to output (nodal values in DOF-order) |
| [in] | fieldName | Name identifying the vector field |
| [in] | iStep | Load/time step identifier |
| nBlock | Running result block counter | |
| [in] | idBlock | Result block ID number |
| [in] | ncmp | Number of components in vector field |
References IFEM::cout, extractNodeVec(), mergeVtf, SIMadmin::msgLevel, myGeomID, SIMbase::myModel, myVtf, SIMoptions::nViz, SIMadmin::opt, VTF::writeVblk(), and VTF::writeVres().
Referenced by MultiStepSIM::saveStep().