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

Base class for spline-based finite element (FE) assembly drivers. More...

#include <ASMbase.h>

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

Classes

struct  BC
 Struct for boundary condition codes. More...
 

Public Types

using BCVec = std::vector< BC >
 Nodal boundary condition container.
 

Public Member Functions

virtual ~ASMbase ()
 The destructor frees the dynamically allocated data objects.
 
ASMbasecloneUnShared () const
 Returns a copy of this patch with identical FE discretization. More...
 
virtual bool empty () const =0
 Checks if this patch is empty.
 
virtual bool read (std::istream &is)=0
 Creates an instance by reading the given input stream.
 
virtual bool readBasis (std::istream &, size_t)
 Reads a basis from the given input stream.
 
virtual bool write (std::ostream &os, int basis=0) const =0
 Writes the geometry/basis of the patch to the given stream.
 
virtual void addHole (double, double, double)
 Adds a circular immersed boundary in the physical geometry.
 
virtual void addHole (double, double, double, double, double)
 Adds an oval immersed boundary in the physical geometry.
 
virtual bool setGeometry (RealFunc *, double, double)
 Defines the immersed geometry from a scalar function.
 
virtual bool generateFEMTopology ()=0
 Generates the finite element topology data for this patch.
 
virtual void clear (bool retainGeometry=false)
 Clears the contents of this patch, making it empty. More...
 
virtual bool addXElms (short int dim, short int item, size_t nXn, IntVec &nodes)
 Adds extraordinary elements associated with a patch boundary. More...
 
bool addLagrangeMultipliers (size_t iel, const IntVec &mGLag, unsigned char nnLag=1)
 Adds a set of Lagrange multipliers to the specified element. More...
 
bool addGlobalLagrangeMultipliers (const IntVec &mGLag, unsigned char nnLag=1)
 Adds global Lagrange multipliers to the system. More...
 
virtual void setGauss (int ng)
 Defines the numerical integration scheme nGauss in the patch.
 
void setNoFields (unsigned char n)
 Defines the number of solution fields in the patch. More...
 
void setElementActivator (IntFunc *efunc)
 Sets the element activation function.
 
const IntFuncgetElementActivator () const
 Returns a pointer to the element activation function.
 
virtual void setMinimumSize (double)
 Sets the minimum element size for adaptive refinement.
 
virtual double getMinimumSize (int=0) const
 Defines the minimum element size for adaptive refinement.
 
virtual bool checkElementSize (int, bool=true) const
 Checks if the specified element is larger than the minimum size.
 
unsigned char getNoSpaceDim () const
 Returns the number of spatial dimensions.
 
unsigned char getNoParamDim () const
 Returns the number of parameter dimensions.
 
virtual unsigned char getNoFields (int b=0) const
 Returns the number of solution fields.
 
unsigned char getNoLagPerNode () const
 Returns the number of Lagrange multipliers per node.
 
virtual bool getOrder (int &, int &, int &) const
 Returns the polynomial order in each parameter direction.
 
virtual size_t getNodeIndex (int globalNum, bool=false) const
 Returns local 1-based index of the node with given global number. More...
 
virtual int getNodeID (size_t inod, bool=false) const
 Returns the global node number for the given node. More...
 
size_t getElmIndex (int globalNum) const
 Returns local 1-based index of element with given global number. More...
 
int getElmID (size_t iel) const
 Returns the global element number for the given element. More...
 
virtual unsigned char getNodalDOFs (size_t inod) const
 Returns the number of DOFs per node. More...
 
virtual char getNodeType (size_t inod) const
 Returns the classification of a node. More...
 
bool isLMn (size_t n) const
 Returns true if node n is a Lagrange multiplier node.
 
bool isRMn (size_t n) const
 Returns true if node n is a master node of a rigid coupling.
 
char getLMType (size_t inod) const
 Returns the type of a Lagrange multiplier node. More...
 
virtual Vec3 getCoord (size_t inod) const =0
 Returns the global coordinates for the given node. More...
 
virtual void getNodalCoordinates (Matrix &X, bool geo=false) const =0
 Returns a matrix with all nodal coordinates within the patch. More...
 
virtual bool getElementCoordinates (Matrix &X, int iel, bool forceItg=false) const =0
 Returns a matrix with nodal coordinates for an element. More...
 
virtual Vec3 getElementCenter (int) const =0
 Returns the coordinates of the element center.
 
virtual void getBoundaryNodes (int lIndex, IntVec &nodes, int basis=0, int thick=1, int orient=-1, bool local=false) const =0
 Finds the global (or patch-local) node numbers on a patch boundary. More...
 
virtual void getBoundary1Nodes (int lIndex, IntVec &nodes, int basis=0, int orient=-1, bool local=false, bool open=false) const
 Finds the global (or patch-local) node numbers on a patch boundary. More...
 
void getBoundaryElms (int lIndex, IntVec &elms, int orient=-1, bool local=false) const
 Finds the global (or patch-local) element numbers on a boundary. More...
 
virtual int getNodeSetIdx (const std::string &) const
 Returns (1-based) index of a predefined node set in the patch.
 
virtual const IntVecgetNodeSet (int) const
 Returns an indexed predefined node set.
 
virtual bool isInNodeSet (int, int) const
 Checks if a node is within a predefined node set.
 
virtual int parseNodeSet (const std::string &, const char *)
 Defines a node set by parsing a list of node numbers.
 
virtual int parseNodeBox (const std::string &, const char *)
 Defines a node set by parsing a 3D bounding box.
 
virtual int getElementSetIdx (const std::string &) const
 Returns (1-based) index of a predefined element set in the patch.
 
virtual const IntVecgetElementSet (int) const
 Returns an indexed predefined element set.
 
virtual bool getElementSet (int, std::string &) const
 Returns the name of an indexed predefined element set.
 
virtual bool isInElementSet (int, int) const
 Checks if an element is within a predefined element set.
 
virtual int parseElemSet (const std::string &, const char *)
 Defines an element set by parsing a list of element numbers.
 
virtual int parseElemBox (const std::string &, const std::string &, const char *)
 Defines an element set by parsing a 3D bounding box.
 
virtual std::pair< size_t, double > findClosestNode (const Vec3 &) const
 Finds the node that is closest to the given point.
 
void printNodes (std::ostream &os) const
 Prints out the nodal coordinates of this patch to the given stream.
 
void printElements (std::ostream &os) const
 Prints out element connections of this patch to the given stream.
 
virtual void printElmInfo (int, const IntegrandBase *) const
 Prints out additional app-dependent element information.
 
virtual void shiftGlobalNodeNums (int nshift)
 Increase all global node numbers by nshift.
 
void setGlobalNodeNums (const IntVec &nodes)
 Sets the global node numbers for this patch.
 
const IntVecgetMyNodeNums () const
 Returns the actual global node numbers of this patch.
 
const IntVecgetGlobalNodeNums () const
 Returns the global node numbers of this patch.
 
virtual void shiftGlobalElmNums (int eshift)
 Increase all global element numbers by eshift.
 
const IntVecgetGlobalElementNums () const
 Returns the global element numbers of this patch.
 
void setActiveElements (IntVec *active)
 Sets the list of active elements during assembly.
 
bool isElementActive (int iel, double time=-1.0) const
 Returns true if element with 0-based index iel is active.
 
bool inActive (double time) const
 Returns true if none of the elements in the patch are active.
 
double getAge (int iel, double time) const
 Returns the age of the element with 0-based index iel.
 
bool isElementInPartition (int iel) const
 Returns true if element is in process partition. More...
 
const IntVecgetElementNodes (int iel) const
 Returns the nodal point correspondance array for an element. More...
 
virtual size_t getNoBasis () const
 Returns number of bases of this patch.
 
virtual size_t getNoNodes (int basis=0) const
 Returns the total number of nodes in this patch.
 
size_t getNoElms (bool includeZeroVolElms=false, bool includeXElms=false) const
 Returns the total number of elements in this patch. More...
 
int getMaxElmNo () const
 Returns the highest external element number in this patch.
 
virtual size_t getNoBoundaryElms (char, char) const
 Returns the number of elements on a boundary.
 
size_t getNoMPCs () const
 Returns the total number of multi-point constraint equations.
 
virtual void getNoIntPoints (size_t &nPt, size_t &nIPt)
 Computes the total number of integration points in this patch.
 
virtual void getNoBouPoints (size_t &nPt, char ldim, char lindx)
 Computes the number of boundary integration points in this patch.
 
BCVec::const_iterator begin_BC () const
 Returns the beginning of the BCode array.
 
BCVec::const_iterator end_BC () const
 Returns the end of the BCode array.
 
IntMat::const_iterator begin_elm () const
 Returns the beginning of the MNPC array.
 
IntMat::const_iterator end_elm () const
 Returns the end of the MNPC array.
 
MPCIter begin_MPC () const
 Returns the beginning of the mpcs set.
 
MPCIter end_MPC () const
 Returns the end of the mpcs set.
 
MPCfindMPC (int node, int dof) const
 Returns a pointer to the MPC object for a specified slave, if any. More...
 
bool isShared () const
 Returns true if this patch shares FE data with another patch.
 
bool hasXNodes () const
 Returns true if this patch has additional (extraordinary) nodes.
 
virtual bool getParameterDomain (Real2DMat &u, IntVec *corners=nullptr) const =0
 Returns parameter values and node numbers of the domain corners. More...
 
virtual void getElmConnectivities (IntMat &neighs, int basis=ASM::INTEGRATION_BASIS) const =0
 Calculates the matrix of element neighbour connectivities. More...
 
virtual IntMat getElmNodes (int) const
 Returns the matrix of nodal point correspondance for given basis.
 
virtual void copyParameterDomain (const ASMbase *)
 Copies the parameter domain from another patch.
 
virtual void closeBoundaries (int dir=1, int basis=0, int master=1)
 Makes two opposite boundaries periodic. More...
 
bool mergeNodes (size_t inod, int globalNum, bool verbose=true)
 Merges a given node in this patch with a given global node. More...
 
int renumberNodes (std::map< int, int > &old2new, int &nNod)
 Renumbers the global node numbers in this patch. More...
 
bool renumberNodes (const std::map< int, int > &old2new, const std::vector< int > &new2old={}, int renumGN=0, std::map< int, int > *degenElm=nullptr)
 Renumbers the global node numbers referred by this patch. More...
 
virtual bool initConstraints ()
 Initializes the multi-point constraint coefficients.
 
virtual void setNodeNumbers (const IntVec &nodes)
 Sets the global node numbers for this patch. More...
 
bool hasTimeDependentDirichlet (const std::map< int, RealFunc * > &func, const std::map< int, VecFunc * > &vfunc)
 Checks for time-dependent in-homogeneous Dirichlet conditions. More...
 
virtual bool updateDirichlet (const std::map< int, RealFunc * > &func, const std::map< int, VecFunc * > &vfunc, double time=0.0, const std::map< int, int > *g2l=nullptr)
 Updates the time-dependent in-homogeneous Dirichlet coefficients. More...
 
virtual bool updateCoords (const Vector &displ)=0
 Updates the nodal coordinates for this patch. More...
 
virtual bool transform (const Matrix &)
 Applies a transformation matrix from local to global system.
 
virtual void initMADOF (const int *)
 Initializes the patch level MADOF array for mixed problems.
 
virtual void generateThreadGroups (const Integrand &, bool, bool)
 Generates element groups for multi-threading of interior integrals.
 
virtual void generateThreadGroups (char, bool, bool)
 Generates element groups for multi-threading of boundary integrals.
 
virtual void generateThreadGroupsFromElms (const IntVec &)
 Generates element groups for multi-threading based on a partition.
 
virtual void generateProjThreadGroupsFromElms (const IntVec &)
 Generates element groups for multi-threading based on a partition.
 
virtual bool validateThreadGroups (const SAM *) const
 Validates the threading groups based on the assembly data in SAM.
 
virtual void changeNumThreads ()
 Hook for changing number of threads.
 
virtual bool integrate (Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)=0
 Evaluates an integral over the interior patch domain. More...
 
virtual bool integrate (Integrand &integrand, int lIndex, GlobalIntegral &glbInt, const TimeDomain &time)=0
 Evaluates a boundary integral over a patch face/edge. More...
 
virtual bool integrateEdge (Integrand &integrand, int lEdge, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates a boundary integral over a patch edge. More...
 
virtual bool integrate (Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time, const ASM::InterfaceChecker &iChk)
 Evaluates an integral over element interfaces in the patch. More...
 
virtual bool diracPoint (Integrand &integrand, GlobalIntegral &glbInt, const double *u, const Vec3 &p)
 Integrates a spatial dirac-delta function over a patch. More...
 
virtual int evalPoint (const double *xi, double *param, Vec3 &X) const =0
 Evaluates the geometry at a specified point. More...
 
virtual int findElementContaining (const double *param) const =0
 Returns the element that contains a specified spatial point. More...
 
virtual double findPoint (Vec3 &X, double *param) const =0
 Searches for the specified Cartesian point in the patch. More...
 
virtual bool tesselate (ElementBlock &grid, const int *npe) const =0
 Creates a standard FE model of this patch for visualization. More...
 
virtual ElementBlockimmersedGeometry (char *) const
 Returns an additional geometry to visualize (immersed boundaries).
 
virtual ElementBlockextraGeometry (char *) const
 Returns an additional geometry to visualize (spiders, etc.).
 
virtual void filterResults (Matrix &, const ElementBlock *) const
 Filters out result point values that are outside physical domain.
 
virtual bool getSolution (Matrix &sField, const Vector &locSol, const IntVec &nodes) const
 Extract the primary solution field at the specified nodes. More...
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const int *npe, int n_f=0, bool piola=false) const
 Evaluates the primary solution field at all visualization points. More...
 
virtual bool immersedSolution (Matrix &, const Vector &) const
 Evaluates the primary solution at the immersed geometry points.
 
virtual bool extraSolution (Matrix &, const Vector &) const
 Evaluates the primary solution at the extra geometry points.
 
virtual bool evalProjSolution (Matrix &sField, const Vector &locSol, const int *npe, int n_f=0) const
 Evaluates the projected solution field at all visualization points. More...
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const RealArray *gpar, bool regular=true, int deriv=0, int n_f=0) const
 Evaluates the primary solution field at the given points. More...
 
virtual bool evalSolutionPiola (Matrix &sField, const Vector &locSol, const RealArray *gpar, bool regular) const
 Evaluates the primary solution field with Piola mapping. More...
 
virtual bool evaluate (const ASMbase *basis, const Vector &locVec, RealArray &vec, int basisNum=1) const
 Evaluates and interpolates a field over a given geometry. More...
 
virtual bool evaluate (const Field *f, RealArray &vec, int basisNum=1) const
 Evaluates and interpolates a scalar field over a given geometry. More...
 
virtual bool evaluate (const FunctionBase *f, RealArray &vec, int basisNum=1, double time=0.0) const
 Evaluates and interpolates a scalar function over a given geometry. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const int *npe=nullptr, char project=0) const
 Evaluates the secondary solution field at all visualization points. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const RealArray *gpar, bool regular=true) const
 Evaluates the secondary solution field at the given points. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const IntVec &elements) const
 Evaluates the secondary solution field at element centers. More...
 
bool globalL2projection (Matrix &sField, const L2Integrand &integrand, bool continuous=false, bool enforceEnds=false) const
 Projects the secondary solution using a (discrete) global L2-fit. More...
 
bool L2projection (Matrix &sField, IntegrandBase *integrand, const TimeDomain &time)
 Projects the secondary solution using a continuous global L2-fit. More...
 
bool L2projection (Matrix &fVals, FunctionBase *function, double t=0.0)
 Projects an explicit function using a continuous global L2-fit. More...
 
bool L2projection (const std::vector< Matrix * > &fVals, const std::vector< FunctionBase * > &function, double t=0.0)
 Projects explicit functions using a continuous global L2-fit. More...
 
virtual size_t getNoProjectionNodes () const
 Returns the number of projection nodes for this patch.
 
virtual size_t getNoRefineNodes () const
 Returns the number of nodes on refinement basis for this patch.
 
virtual size_t getNoRefineElms () const
 Returns the number of elements on refinement basis for this patch.
 
virtual FieldgetProjectedField (const Vector &) const
 Returns a field using the projection basis.
 
virtual FieldsgetProjectedFields (const Vector &, size_t) const
 Returns a field using the projection basis.
 
virtual bool createProjectionBasis (bool)
 Creates a separate projection basis for this patch.
 
virtual bool separateProjectionBasis () const
 Checks if a separate projection basis is used for this patch.
 
virtual void swapProjectionBasis ()
 Swap between main and alternative projection basis.
 
virtual void extractElmRes (const Vector &globRes, Vector &elmRes, size_t internalFirst=0) const
 Extracts element results for this patch from a global vector. More...
 
virtual void extractElmRes (const Matrix &globRes, Matrix &elmRes, size_t internalFirst=0) const
 Extracts element results for this patch from a global vector. More...
 
bool extractNodalVec (const RealArray &globVec, RealArray &nodeVec, const int *madof, int ngnod=-1) const
 Extracts nodal results for this patch from the global vector. More...
 
virtual void extractNodeVec (const RealArray &globVec, RealArray &nodeVec, unsigned char nndof=0, int basis=0) const
 Extracts nodal results for this patch from the global vector. More...
 
virtual bool injectNodeVec (const RealArray &nodeVec, RealArray &globVec, unsigned char nndof=0, int basis=0) const
 Injects nodal results for this patch into the global vector. More...
 
bool injectNodalVec (const RealArray &nodeVec, RealArray &globVec, const IntVec &madof, int basis=0) const
 Injects nodal results for this patch into the global vector. More...
 
bool add2PC (int slave, int dir, int master, int code=0)
 Creates and adds a two-point constraint to this patch. More...
 
bool addMPC (MPC *&mpc, int code=0, bool verbose=false, bool overrideD=false)
 Adds a general multi-point-constraint (MPC) equation to this patch. More...
 
virtual bool addRigidCpl (int lindx, int ldim, int basis, int &gMaster, const Vec3 &Xmaster, bool extraPt=true)
 Adds MPC-equations representing a rigid coupling to this patch. More...
 
void addRigidCouplings (int gMaster, const Vec3 &Xmaster, const IntVec &slaveNodes)
 Adds MPC-equations representing a rigid coupling to this patch. More...
 
void constrainPatch (int dof, int code=0)
 Constrains all nodes in the patch. More...
 
void constrainNodes (const IntVec &nodes, int dof, int code=0, bool overrideD=false)
 Constrains a list of nodes in the patch. More...
 
bool constrainXnode (int node, int dof, int code=0)
 Constrains an extraordinary node in the patch. More...
 
int prescribe (size_t inod, int dirs, int code, bool overrideD=false)
 Constrains DOFs in the given node to the given value. More...
 
int fix (size_t inod, int dirs=123)
 Constrains DOFs in the given node to zero. More...
 
bool isFixed (int node, int dof, bool all=false) const
 Checks if the given DOFs are fixed. More...
 

Static Public Member Functions

static void resetNumbering (int n=0)
 Resets the global element and node counters.
 
static int renumberNodes (const ASMVec &model, std::map< int, int > &old2new)
 Renumbers all global node numbers in the entire model. More...
 
static void mergeAndGetAllMPCs (const ASMVec &model, MPCSet &allMPCs)
 Computes the set of all MPC-equations over the whole model. More...
 
static void resolveMPCchains (const MPCSet &allMPCs, const ASMVec &model, bool setPtrOnly=false)
 Resolves (possibly multi-level) chaining in MPC-equations. More...
 

Public Attributes

size_t idx
 Index of this patch in the multi-patch model.
 

Static Public Attributes

static bool fixHomogeneousDirichlet = true
 If true, pre-eliminate fixed DOFs.
 
static int dbgElm = 0
 One-based element index to print debugging info for.
 
static double modelSize = 1.0
 Characteristic model size. More...
 

Protected Types

using XYZ = std::array< double, 3 >
 Convenience type definition.
 

Protected Member Functions

 ASMbase (unsigned char n_p, unsigned char n_s, unsigned char n_f)
 The constructor sets the number of space dimensions and fields. More...
 
 ASMbase (const ASMbase &patch, unsigned char n_f)
 Special copy constructor for sharing of FE data. More...
 
 ASMbase (const ASMbase &patch)
 Default copy constructor, copying everything except neighbors. More...
 
void addLocal2GlobalCpl (int iSlave, int master, const Tensor &Tlg)
 Creates constraint equations coupling global DOFs to local DOFs. More...
 
bool add3PC (int slave, int dir, int master1, int master2, int code=0)
 Creates and adds a three-point constraint to this patch. More...
 
bool addPeriodicity (size_t master, size_t slave, int dir)
 Creates and adds a periodicity constraint to this patch. More...
 
void makePeriodic (size_t master, size_t slave, int dirs=123)
 Creates periodicity constraints between two nodes in this patch. More...
 
void addNeighbor (ASMbase *pch)
 Adds a patch to the list of neighbors of this patch. More...
 
bool createRgdMasterNode (int &gMaster, const Vec3 &Xmaster)
 Creates an additional master node for a rigid coupling. More...
 
void addRigidMPC (int gSlave, int gMaster, const Vec3 &dX)
 Adds MPC-equations representing a rigid arm to a 6-DOF node. More...
 
int getNoGaussPt (int p, bool neumann=false) const
 Returns the number of Gauss points to use in one direction. More...
 
int searchCtrlPt (RealArray::const_iterator cit, RealArray::const_iterator end, const Vec3 &X, int dimension, double tol=0.001) const
 Helper method used by evalPoint to search for a control point. More...
 
virtual void findBoundaryElms (IntVec &elms, int lIndex, int orient) const =0
 Finds the patch-local element numbers on a patch boundary. More...
 
virtual bool assembleL2matrices (SystemMatrix &A, SystemVector &B, const L2Integrand &obj, bool continuous) const
 Assembles L2-projection matrices for the secondary solution. More...
 
bool allDofs (int dirs) const
 Returns true if dirs constains all local DOFs in the patch.
 
bool writeLagBasis (std::ostream &os, const char *type) const
 Writes a Lagrangian basis to the given stream.
 

Static Protected Member Functions

static bool deformedConfig (const Matrix &Xnod, Vectors &eVec, bool force2nd=false)
 Calculates the deformed configuration for current element. More...
 
static bool collapseNodes (ASMbase &pch1, int node1, ASMbase &pch2, int node2)
 Collapses the given two nodes into one. More...
 

Protected Attributes

unsigned char ndim
 Number of parametric dimensions (1, 2 or 3)
 
unsigned char nsd
 Number of space dimensions (ndim <= nsd <= 3)
 
unsigned char nf
 Number of primary solution fields (1 or larger)
 
unsigned char nLag
 Number of Lagrange multipliers per node.
 
size_t nel
 Number of regular elements in this patch.
 
size_t nnod
 Number of regular nodes in this patch.
 
const IntVecMLGE
 Matrix of Local to Global Element numbers.
 
const IntVecMLGN
 Matrix of Local to Global Node numbers.
 
const IntMatMNPC
 Matrix of Nodal Point Correspondance.
 
const char shareFE
 Flag telling whether this patch shares its data with another patch. More...
 
BCVec BCode
 Array of Boundary Condition codes.
 
MPCMap dCode
 Inhomogeneous Dirichlet condition codes for the MPCs.
 
MPCSet mpcs
 All multi-point constraints with the slave in this patch.
 
IntVec myMLGE
 The actual Matrix of Local to Global Element numbers.
 
IntVec myMLGN
 The actual Matrix of Local to Global Node numbers.
 
IntMat myMNPC
 The actual Matrix of Nodal Point Correspondance.
 
IntVec myElms
 Elements on patch - used with partitioning.
 
int nGauss
 Numerical integration scheme for this patch. More...
 
size_t firstEl
 Global index to first element within this patch.
 
size_t firstIp
 Global index to first interior integration point.
 
std::map< char, size_t > firstBp
 Global indices to first integration point for the Neumann boundaries.
 
ASMVec neighbors
 Patches having nodes in common with this one.
 
std::map< size_t, XYZmyRmaster
 Rigid master nodal points.
 

Static Protected Attributes

static std::map< int, int > xNode
 Auxilliary node number map used when establishing Dirichlet constraints.
 
static int gEl = 0
 Global element counter.
 
static int gNod = 0
 Global node counter.
 

Private Attributes

std::vector< char > myLMTypes
 Type of Lagrange multiplier ('L' or 'G')
 
std::set< size_t > myLMs
 Nodal indices of the Lagrange multipliers.
 
IntFuncmyElActive
 Function returning activatiation time of element.
 
IntVecmyActiveEls
 List of active elements during element assembly.
 

Static Private Attributes

static IntVec Empty
 Empty integer vector used when a reference is needed.
 

Detailed Description

Base class for spline-based finite element (FE) assembly drivers.

This class incapsulates the data and methods needed for assembling the algebraic equation system resulting from a finite element discretization of a set of partial differential equations using splines as basis functions.

The class does not contain any problem-specific data or methods. The methods that need access to problem information are given that through Integrand objects that are passed as arguments to those methods.

Constructor & Destructor Documentation

◆ ASMbase() [1/3]

ASMbase::ASMbase ( unsigned char  n_p,
unsigned char  n_s,
unsigned char  n_f 
)
protected

The constructor sets the number of space dimensions and fields.

Parameters
[in]n_pNumber of parameter dimensions
[in]n_sNumber of spatial dimensions
[in]n_fNumber of primary solution fields

References firstEl, firstIp, idx, myElActive, ndim, nel, nf, nGauss, nLag, nnod, and nsd.

◆ ASMbase() [2/3]

ASMbase::ASMbase ( const ASMbase patch,
unsigned char  n_f 
)
protected

Special copy constructor for sharing of FE data.

Parameters
[in]patchThe patch to use FE data from
[in]n_fNumber of primary solution fields

This copy constructor makes this patch sharing the FE data (including the basis functions) with the provided patch. The boundary conditions and constraint equations are however not copied, as this copy constructor is typically used for multi-stage simulators with different sub-problems discretized on the same grid.

References firstEl, firstIp, idx, myElActive, ndim, nel, nf, nGauss, nLag, nnod, and nsd.

◆ ASMbase() [3/3]

ASMbase::ASMbase ( const ASMbase patch)
protected

Default copy constructor, copying everything except neighbors.

Parameters
[in]patchThe patch to copy

References dCode, firstEl, firstIp, idx, MLGE, MLGN, MNPC, mpcs, myElActive, myMLGE, myMLGN, myMNPC, ndim, nel, nf, nGauss, nLag, nnod, and nsd.

Member Function Documentation

◆ add2PC()

bool ASMbase::add2PC ( int  slave,
int  dir,
int  master,
int  code = 0 
)

Creates and adds a two-point constraint to this patch.

Parameters
[in]slaveGlobal node number of the node to constrain
[in]dirWhich local DOF to constrain (1, 2, 3)
[in]masterGlobal node number of the master node of the constraint
[in]codeIdentifier for inhomogeneous Dirichlet condition field

References MPC::addMaster(), addMPC(), and nf.

Referenced by add3PC(), ASMs2DC1::addC1MPC(), addPeriodicity(), ASMs1DC1::constrainNode(), and NodalConstraintASMHelper::constrainNode().

◆ add3PC()

bool ASMbase::add3PC ( int  slave,
int  dir,
int  master1,
int  master2,
int  code = 0 
)
protected

Creates and adds a three-point constraint to this patch.

Parameters
[in]slaveGlobal node number of the node to constrain
[in]dirWhich local DOF to constrain (1, 2, 3)
[in]master1Global node number of 1st master node of the constraint
[in]master2Global node number of 2nd master node of the constraint
[in]codeIdentifier for inhomogeneous Dirichlet condition field

References add2PC(), MPC::addMaster(), addMPC(), and nf.

Referenced by ASMs2DC1::addC1MPC().

◆ addGlobalLagrangeMultipliers()

bool ASMbase::addGlobalLagrangeMultipliers ( const IntVec mGLag,
unsigned char  nnLag = 1 
)

Adds global Lagrange multipliers to the system.

Parameters
[in]mGLagGlobal node numbers of the Lagrange multipliers
[in]nnLagNumber of Lagrange multipliers to add

References addLagrangeMultipliers().

◆ addLagrangeMultipliers()

bool ASMbase::addLagrangeMultipliers ( size_t  iel,
const IntVec mGLag,
unsigned char  nnLag = 1 
)

Adds a set of Lagrange multipliers to the specified element.

Parameters
[in]iel1-based element index local to current patch
[in]mGLagGlobal node numbers of the Lagrange multipliers
[in]nnLagNumber of Lagrange multipliers per node

References utl::findIndex(), MLGN, MNPC, myLMs, myLMTypes, myMLGN, myMNPC, nLag, and shareFE.

Referenced by addGlobalLagrangeMultipliers().

◆ addLocal2GlobalCpl()

void ASMbase::addLocal2GlobalCpl ( int  iSlave,
int  master,
const Tensor Tlg 
)
protected

Creates constraint equations coupling global DOFs to local DOFs.

Parameters
[in]iSlave0-based local index of node with global DOFs
[in]masterGlobal node number of node with local DOFs
[in]TlgLocal-to-global transformation matrix

References addMPC(), isFixed(), MLGN, mpcs, nf, and nsd.

Referenced by ASMs1D::constrainEndLocal(), and ASMs1DC1::constrainEndLocal().

◆ addMPC()

bool ASMbase::addMPC ( MPC *&  mpc,
int  code = 0,
bool  verbose = false,
bool  overrideD = false 
)

Adds a general multi-point-constraint (MPC) equation to this patch.

Parameters
mpcPointer to an MPC object
[in]codeIdentifier for inhomogeneous Dirichlet condition field
[in]verboseIf true, print out added constraint (debug build)
[in]overrideDIf true, override current Dirichlet conditions

References BCode, dCode, MPC::DOF::dof, MPC::getSlave(), mpcs, MPC::DOF::node, and eig::verbose.

Referenced by add2PC(), add3PC(), addLocal2GlobalCpl(), ASMs2DC1::addRigidCpl(), ASMs1DC1::addRigidCpl(), ASMs2D::constrainEdgeLocal(), ASMs3D::constrainFaceLocal(), and prescribe().

◆ addNeighbor()

void ASMbase::addNeighbor ( ASMbase pch)
protected

Adds a patch to the list of neighbors of this patch.

Parameters
[in]pchPointer to the neighboring patch

References neighbors.

Referenced by ASMs2Dmx::connectPatch(), ASMs2DmxLag::connectPatch(), ASMu2Dmx::connectPatch(), ASMu2D::connectPatch(), ASMs3Dmx::connectPatch(), ASMs3DmxLag::connectPatch(), ASMs3D::connectPatch(), ASMu3D::connectPatch(), and ASMs1D::connectPatch().

◆ addPeriodicity()

bool ASMbase::addPeriodicity ( size_t  master,
size_t  slave,
int  dir 
)
protected

Creates and adds a periodicity constraint to this patch.

Parameters
[in]master1-based local index of the master node
[in]slave1-based local index of the slave node to constrain
[in]dirWhich local DOF to constrain (1, 2, 3)

References add2PC(), and getNodeID().

Referenced by makePeriodic().

◆ addRigidCouplings()

void ASMbase::addRigidCouplings ( int  gMaster,
const Vec3 Xmaster,
const IntVec slaveNodes 
)

Adds MPC-equations representing a rigid coupling to this patch.

Parameters
[in]gMasterGlobal node number of the master node
[in]slaveNodesLocal node numbers of the slave nodes
[in]XmasterPosition of the master node

References getCoord().

◆ addRigidCpl()

bool ASMbase::addRigidCpl ( int  lindx,
int  ldim,
int  basis,
int &  gMaster,
const Vec3 Xmaster,
bool  extraPt = true 
)
virtual

Adds MPC-equations representing a rigid coupling to this patch.

Parameters
[in]lindxLocal index of the boundary item that should be rigid
[in]ldimDimension of the boundary item that should be rigid
[in]basisWhich basis to add rigid coupling for (mixed methods)
gMasterGlobal node number of the master node
[in]XmasterPosition of the master nodal point
[in]extraPtIf true, the master point is not a patch node
Returns
true if a new global node was added, otherwise false

Reimplemented in ASMs1DC1, ASMs3D, ASMs2DC1, and ASMs2D.

Referenced by ASMs2D::addRigidCpl(), and ASMs3D::addRigidCpl().

◆ addRigidMPC()

void ASMbase::addRigidMPC ( int  gSlave,
int  gMaster,
const Vec3 dX 
)
protected

Adds MPC-equations representing a rigid arm to a 6-DOF node.

Parameters
[in]gSlaveGlobal node number of the 3-DOF slave node
[in]gMasterGlobal node number of the 6-DOF master node
[in]dXRelative position of the slave w.r.t. the master node

References nf.

Referenced by ASMs2DC1::addRigidCpl(), and ASMs1DC1::addRigidCpl().

◆ addXElms()

bool ASMbase::addXElms ( short int  dim,
short int  item,
size_t  nXn,
IntVec nodes 
)
virtual

Adds extraordinary elements associated with a patch boundary.

Parameters
[in]dimDimension of the boundary (should equal nsd - 1)
[in]itemLocal index of the boundary face/edge
[in]nXnNumber of extraordinary nodes
[out]nodesGlobal numbers assigned to the extraordinary nodes

Reimplemented in ASMs3DLag, ASMs3D, ASMs2DTri, ASMs2DLag, and ASMs2D.

References Aerror().

◆ assembleL2matrices()

virtual bool ASMbase::assembleL2matrices ( SystemMatrix A,
SystemVector B,
const L2Integrand obj,
bool  continuous 
) const
inlineprotectedvirtual

Assembles L2-projection matrices for the secondary solution.

Parameters
[out]ALeft-hand-side matrix
[out]BRight-hand-side vectors
[in]objWrapper object for integrand/function
[in]continuousIf false, a discrete L2-projection is used

Reimplemented in ASMu3D, ASMu2D, ASMs3DLag, ASMs3D, ASMs2DLag, ASMs2D, and ASMs1D.

Referenced by globalL2projection().

◆ clear()

void ASMbase::clear ( bool  retainGeometry = false)
virtual

Clears the contents of this patch, making it empty.

Parameters
[in]retainGeometryIf true, the spline geometry is not cleared. This is used to reinitialize the patch after it has been refined.

Reimplemented in ASMu3D, ASMu2D, ASMs3DLag, ASMs3D, ASMs2DLag, ASMs2D, ASMs1DLag, ASMs1D, ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, and ASMs2Dmx.

References BCode, dCode, MLGE, MLGN, MNPC, mpcs, myActiveEls, myLMs, myLMTypes, myMLGE, myMLGN, myMNPC, myRmaster, and shareFE.

Referenced by ASMs1D::clear(), ASMs2D::clear(), ASMs3D::clear(), ASMu2D::clear(), ASMu3D::clear(), and SIMbase::preprocessC().

◆ cloneUnShared()

ASMbase * ASMbase::cloneUnShared ( ) const

Returns a copy of this patch with identical FE discretization.

Note
The copied patch shares the spline data structures with the copy, in order to save memory. Thus, the copy cannot be read from file, refined, or changed in other ways that affect the FE geometry and/or topology. The other properties of the patch (FE topology, boundary conditions, constraints, loads, etc.) are however not copied.

References ASM2D::clone(), and ASM3D::clone().

◆ closeBoundaries()

virtual void ASMbase::closeBoundaries ( int  dir = 1,
int  basis = 0,
int  master = 1 
)
inlinevirtual

Makes two opposite boundaries periodic.

Parameters
[in]dirParameter direction defining the periodic boundaries
[in]basisWhich basis to connect (mixed methods)
[in]master1-based index of the first master node in this basis

Reimplemented in ASMs1D, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, ASMs2Dmx, ASMs2DC1, ASMs3D, and ASMs2D.

Referenced by MultiPatchModelGenerator1D::createTopology(), MultiPatchModelGenerator2D::createTopology(), MultiPatchModelGenerator3D::createTopology(), and SIMinput::parsePeriodic().

◆ collapseNodes()

bool ASMbase::collapseNodes ( ASMbase pch1,
int  node1,
ASMbase pch2,
int  node2 
)
staticprotected

Collapses the given two nodes into one.

The global node number of the node with the highest number is changed into the number of the other node.

References idx, mergeNodes(), MLGN, and myMLGN.

Referenced by ASMs2D::collapseEdge(), ASMs3D::collapseFace(), ASMs1D::connectBasis(), ASMs3D::connectBasis(), ASMu3D::connectBasis(), and makePeriodic().

◆ constrainNodes()

void ASMbase::constrainNodes ( const IntVec nodes,
int  dof,
int  code = 0,
bool  overrideD = false 
)

Constrains a list of nodes in the patch.

Parameters
[in]nodes1-based list of nodes to constrain
[in]dofWhich DOFs to constrain at each node
[in]codeInhomogeneous Dirichlet condition code
[in]overrideDIf true, override current Dirichlet conditions

References getNoNodes(), and prescribe().

◆ constrainPatch()

void ASMbase::constrainPatch ( int  dof,
int  code = 0 
)

Constrains all nodes in the patch.

Parameters
[in]dofWhich DOFs to constrain at each node in the patch
[in]codeInhomogeneous Dirichlet condition code

References getNoNodes(), and prescribe().

◆ constrainXnode()

bool ASMbase::constrainXnode ( int  node,
int  dof,
int  code = 0 
)

Constrains an extraordinary node in the patch.

Parameters
[in]nodeGlobal node number of the node to constrain
[in]dofWhich DOFs to constrain at the node
[in]codeInhomogeneous Dirichlet condition code
Returns
true if node is a rigid master point in the patch, otherwise false

References isRMn(), MLGN, nnod, and prescribe().

◆ createRgdMasterNode()

bool ASMbase::createRgdMasterNode ( int &  gMaster,
const Vec3 Xmaster 
)
protected

Creates an additional master node for a rigid coupling.

Parameters
gMasterGlobal node number of the master node
[in]XmasterPosition of the master nodal point
Returns
true if a new global node was added, otherwise false

References gNod, idx, MLGN, myMLGN, myRmaster, nnod, Vec3::x, Vec3::y, and Vec3::z.

Referenced by ASMs2DC1::addRigidCpl(), and ASMs1DC1::addRigidCpl().

◆ deformedConfig()

bool ASMbase::deformedConfig ( const Matrix Xnod,
Vectors eVec,
bool  force2nd = false 
)
staticprotected

Calculates the deformed configuration for current element.

Parameters
[in]XnodMatrix of nodal point coordinates for current element
eVecCurrent element solution vectors
[in]force2ndIf true, put updated coordinates as the 2nd vector

This method calculates the updated (control point) coordinates of current element by adding the current displacement vector stored as the first vector in eVec to the nodal coordinates of the reference configuration. The result is stored as the last vector in eVec, unless force2nd is true and eVec already contains two or more vectors. In that case the second vector will be overwritten

References utl::vector< T >::add(), utl::matrix< T >::cols(), nsd, utl::matrix< T >::rows(), utl::vector< T >::size(), and utl::matrixBase< T >::size().

Referenced by ASMs2D::evalSolution(), ASMu2D::evalSolution(), ASMs2D::integrate(), and ASMu2D::integrate().

◆ diracPoint()

virtual bool ASMbase::diracPoint ( Integrand integrand,
GlobalIntegral glbInt,
const double *  u,
const Vec3 p 
)
inlinevirtual

Integrates a spatial dirac-delta function over a patch.

Parameters
integrandObject with problem-specific data and methods
glbIntThe integrated quantity
[in]uParameters of the non-zero point of the dirac-delta function
[in]pFunction value at the specified point

Reimplemented in ASMu3D, ASMu2D, and ASMstruct.

◆ evalPoint()

virtual int ASMbase::evalPoint ( const double *  xi,
double *  param,
Vec3 X 
) const
pure virtual

Evaluates the geometry at a specified point.

Parameters
[in]xiDimensionless parameters in range [0.0,1.0] of the point
[out]paramThe parameters of the point in the knot-span domain
[out]XThe Cartesian coordinates of the point
Returns
Local node number within the patch that matches the point

Implemented in ASMu3D, ASMu2D, ASMs3Dmx, ASMs3DLag, ASMs3D, ASMs2Dmx, ASMs2DLag, ASMs2D, ASMs1DLag, ASMs1D, and ASMsupel.

Referenced by SIMgeneric::evalPoint(), L2FuncIntegrand::evaluate(), and SIMinput::parseDualTag().

◆ evalProjSolution()

virtual bool ASMbase::evalProjSolution ( Matrix sField,
const Vector locSol,
const int *  npe,
int  n_f = 0 
) const
inlinevirtual

Evaluates the projected solution field at all visualization points.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector local to current patch
[in]npeNumber of visualization nodes over each knot span
[in]n_fIf nonzero, mixed evaluates n_f fields on first basis

Reimplemented in ASMs1D, ASMu3D, ASMu2D, ASMs3D, and ASMs2D.

References evalSolution().

◆ evalSolution() [1/5]

bool ASMbase::evalSolution ( Matrix sField,
const IntegrandBase integrand,
const int *  npe = nullptr,
char  project = 0 
) const
virtual

Evaluates the secondary solution field at all visualization points.

Parameters
[out]sFieldSolution field
[in]integrandObject with problem-specific data and methods
[in]npeNumber of visualization nodes over each knot span
[in]projectFlag indicating result recovery method

The secondary solution is derived from the primary solution, which is assumed to be stored within the integrand for current patch. If npe is null, the solution is recovered or evaluated at the Greville points and then projected onto the spline basis to obtain the control point values, which then are returned through sField. If npe is not null and project is defined, the solution is also projected onto the spline basis, and then evaluated at the npe points.

Reimplemented in ASMs3D, ASMs2D, ASMs1D, ASMu3D, ASMu2D, ASMs3DmxLag, ASMs2DTri, ASMs2DmxLag, ASMs3DLag, ASMs2DLag, and ASMs1DLag.

References Aerror().

◆ evalSolution() [2/5]

bool ASMbase::evalSolution ( Matrix sField,
const IntegrandBase integrand,
const IntVec elements 
) const
virtual

Evaluates the secondary solution field at element centers.

Parameters
[out]sFieldSolution field
[in]integrandObject with problem-specific data and methods
[in]elementsList of elements to evaluate for (all if empty)

The secondary solution is derived from the primary solution, which is assumed to be stored within the integrand for current patch. This method evaluates the secondary solution at the center of the provided list of elements, or for all if the list is empty.

References Aerror(), and evalSolution().

◆ evalSolution() [3/5]

bool ASMbase::evalSolution ( Matrix sField,
const IntegrandBase integrand,
const RealArray gpar,
bool  regular = true 
) const
virtual

Evaluates the secondary solution field at the given points.

Parameters
[out]sFieldSolution field
[in]integrandObject with problem-specific data and methods
[in]gparParameter values of the result sampling points
[in]regularFlag indicating how the sampling points are defined

The secondary solution is derived from the primary solution, which is assumed to be stored within the integrand for current patch. When regular is true, it is assumed that the parameter value array gpar forms a regular tensor-product point grid of dimension gpar[0].size() X gpar[1].size() X gpar[2].size(). Otherwise, we assume that it contains the u, v and w parameters directly for each sampling point.

Reimplemented in ASMs1D, ASMu3D, ASMu2D, ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs2DmxLag, ASMs3D, ASMs2D, ASMs3Dmx, ASMs3DLag, ASMs2Dmx, ASMs2DLag, ASMs3DSpec, ASMs2DSpec, ASMs1DSpec, ASMs1DLag, and ASMs2DTri.

References Aerror().

◆ evalSolution() [4/5]

bool ASMbase::evalSolution ( Matrix sField,
const Vector locSol,
const int *  npe,
int  n_f = 0,
bool  piola = false 
) const
virtual

Evaluates the primary solution field at all visualization points.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector local to current patch
[in]npeNumber of visualization nodes over each knot span
[in]n_fIf nonzero, mixed evaluates n_f fields on first basis
[in]piolaIf true, use piola mapping

Reimplemented in ASMs1D, ASMu3D, ASMu2D, ASMs3D, ASMs2D, ASMsupel, ASMs1DLag, ASMs3DLag, and ASMs2DLag.

References Aerror().

Referenced by evalProjSolution(), SIMoutput::evalResults(), SIMbase::evalSecondarySolution(), evalSolution(), ASMs2DLag::evaluate(), ASMs3DLag::evaluate(), L2ProbIntegrand::evaluate(), and HDF5Writer::writeSIM().

◆ evalSolution() [5/5]

bool ASMbase::evalSolution ( Matrix sField,
const Vector locSol,
const RealArray gpar,
bool  regular = true,
int  deriv = 0,
int  n_f = 0 
) const
virtual

Evaluates the primary solution field at the given points.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector local to current patch
[in]gparParameter values of the result sampling points
[in]regularFlag indicating how the sampling points are defined
[in]derivDerivative order to return
[in]n_fIf nonzero, mixed evaluates n_f fields on first basis

When regular is true, it is assumed that the parameter value array gpar forms a regular tensor-product point grid of dimension gpar[0].size() X gpar[1].size() X gpar[2].size(). Otherwise, we assume that it contains the u, v and w parameters directly for each sampling point.

Reimplemented in ASMs1D, ASMu3D, ASMu2D, ASMu3Dmx, ASMu2Dmx, ASMs3D, ASMs2D, ASMs3DLag, ASMs2DLag, ASMs3Dmx, ASMs2Dmx, ASMs1DLag, ASMs3DmxLag, and ASMs2DmxLag.

References Aerror().

◆ evalSolutionPiola()

bool ASMbase::evalSolutionPiola ( Matrix sField,
const Vector locSol,
const RealArray gpar,
bool  regular 
) const
virtual

Evaluates the primary solution field with Piola mapping.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector local to current patch
[in]gparParameter values of the result sampling points
[in]regularFlag indicating how the sampling points are defined

When regular is true, it is assumed that the parameter value array gpar forms a regular tensor-product point grid of dimension gpar[0].size() X gpar[1].size() X gpar[2].size(). Otherwise, we assume that it contains the u, v and w parameters directly for each sampling point.

Reimplemented in ASMu2Dmx, and ASMs2Dmx.

References Aerror().

Referenced by ASMs2D::evalSolution(), ASMs3D::evalSolution(), ASMu2D::evalSolution(), and ASMu3D::evalSolution().

◆ evaluate() [1/3]

bool ASMbase::evaluate ( const ASMbase basis,
const Vector locVec,
RealArray vec,
int  basisNum = 1 
) const
virtual

Evaluates and interpolates a field over a given geometry.

Parameters
[in]basisThe basis of the field to evaluate
[in]locVecThe coefficients of the field to evaluate
[out]vecThe obtained coefficients after interpolation
[in]basisNumThe basis to evaluate for (mixed)

Reimplemented in ASMs3DLag, ASMs3D, ASMs2DLag, and ASMs2D.

References Aerror().

Referenced by SIMinput::setInitialCondition().

◆ evaluate() [2/3]

bool ASMbase::evaluate ( const Field f,
RealArray vec,
int  basisNum = 1 
) const
virtual

Evaluates and interpolates a scalar field over a given geometry.

Parameters
[in]fThe field to evaluate
[out]vecThe obtained coefficients after interpolation
[in]basisNumThe basis to evaluate for (mixed)

Reimplemented in ASMs3D, and ASMs2D.

References Aerror().

◆ evaluate() [3/3]

bool ASMbase::evaluate ( const FunctionBase f,
RealArray vec,
int  basisNum = 1,
double  time = 0.0 
) const
virtual

Evaluates and interpolates a scalar function over a given geometry.

Parameters
[in]fThe function to evaluate
[out]vecThe obtained coefficients after interpolation
[in]basisNumThe basis to evaluate for (mixed)
[in]timeCurrent time

Reimplemented in ASMu3D, ASMu2D, ASMs1D, ASMs3D, and ASMs2D.

References Aerror().

◆ extractElmRes() [1/2]

void ASMbase::extractElmRes ( const Matrix globRes,
Matrix elmRes,
size_t  internalFirst = 0 
) const
virtual

Extracts element results for this patch from a global vector.

Parameters
[in]globResGlobal matrix of element results
[out]elmResElement results for this patch
[in]internalFirstIf non-zero, the data in globRes are assumed to be ordered w.r.t. the internal element ordering, and the actual value is the global index of the first element in the patch

Reimplemented in ASMu3D, and ASMu2D.

References utl::matrix< T >::cols(), utl::matrix< T >::fillColumn(), utl::matrix< T >::getColumn(), MLGE, MNPC, utl::matrix< T >::resize(), and utl::matrix< T >::rows().

◆ extractElmRes() [2/2]

void ASMbase::extractElmRes ( const Vector globRes,
Vector elmRes,
size_t  internalFirst = 0 
) const
virtual

Extracts element results for this patch from a global vector.

Parameters
[in]globResGlobal vector of element results
[out]elmResElement results for this patch
[in]internalFirstIf non-zero, the data in globRes are assumed to be ordered w.r.t. the internal element ordering, and the actual value is the global index of the first element in the patch

References utl::vector< T >::clear(), idx, MLGE, MNPC, utl::vector< T >::push_back(), utl::vector< T >::reserve(), and utl::vector< T >::size().

Referenced by ASMu2D::extractElmRes(), ASMu3D::extractElmRes(), and SIMbase::extractPatchElmRes().

◆ extractNodalVec()

bool ASMbase::extractNodalVec ( const RealArray globVec,
RealArray nodeVec,
const int *  madof,
int  ngnod = -1 
) const

Extracts nodal results for this patch from the global vector.

Parameters
[in]globVecGlobal solution vector in DOF-order
[out]nodeVecNodal result vector for this patch
[in]madofGlobal Matrix of Accumulated DOFs
[in]ngnodDimension of madof (the default -1 means unknown)

References MLGN, nf, and nnod.

Referenced by SIMoutput::evalResults(), SIMoutput::extractNodeVec(), SIMdependency::extractPatchDependencies(), and SIMbase::extractPatchSolution().

◆ extractNodeVec()

void ASMbase::extractNodeVec ( const RealArray globVec,
RealArray nodeVec,
unsigned char  nndof = 0,
int  basis = 0 
) const
virtual

Extracts nodal results for this patch from the global vector.

Parameters
[in]globVecGlobal solution vector in DOF-order
[out]nodeVecNodal result vector for this patch
[in]nndofNumber of DOFs per node (the default is nf)
[in]basisWhich basis to extract nodal values for (mixed methods)

Reimplemented in ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, and ASMs2Dmx.

References getNodeID(), MLGN, myLMs, and nf.

Referenced by SIMoutput::extractNodeVec(), SIMdependency::extractPatchDependencies(), and SIMbase::extractPatchSolution().

◆ findBoundaryElms()

virtual void ASMbase::findBoundaryElms ( IntVec elms,
int  lIndex,
int  orient 
) const
protectedpure virtual

Finds the patch-local element numbers on a patch boundary.

Parameters
[out]elmsArray of element numbers
[in]lIndexLocal index of the boundary face/edge/vertex
[in]orientLocal orientation flag (for LR splines only)

Implemented in ASMs3DLag, ASMs3D, ASMs2DLag, ASMs2D, ASMs1D, ASMu3D, ASMu2D, and ASMsupel.

Referenced by getBoundaryElms().

◆ findElementContaining()

virtual int ASMbase::findElementContaining ( const double *  param) const
pure virtual

Returns the element that contains a specified spatial point.

Parameters
[in]paramThe parameters of the point in the knot-span domain
Returns
Local element number within the patch that contains the point

Implemented in ASMu3D, ASMu2D, ASMs3D, ASMs2D, ASMs1D, and ASMsupel.

Referenced by ASMstruct::diracPoint(), SIMgeneric::findElementContaining(), DualRealFunc::inDomain(), and DualRealFunc::initPatch().

◆ findMPC()

MPC * ASMbase::findMPC ( int  node,
int  dof 
) const

Returns a pointer to the MPC object for a specified slave, if any.

Parameters
[in]nodeGlobal node number of the slave node
[in]dofWhich local DOF which is constrained (1, 2, 3)

◆ findPoint()

virtual double ASMbase::findPoint ( Vec3 X,
double *  param 
) const
pure virtual

Searches for the specified Cartesian point in the patch.

Parameters
XThe Cartesian coordinates of the point, updated on output
[out]paramThe parameters of the point in the knot-span domain
Returns
Distance from the point X to the found point

Implemented in ASMu3D, ASMu2D, ASMs3D, ASMs2D, ASMs1D, and ASMsupel.

◆ fix()

int ASMbase::fix ( size_t  inod,
int  dirs = 123 
)

Constrains DOFs in the given node to zero.

Parameters
[in]inod1-based node index local to current patch
[in]dirsWhich local DOFs to constrain (1, 2, 3, 12, 23, 123)
Returns
Invalid local DOFs

References BCode, ASMbase::BC::fix(), utl::getDigits(), getNodeID(), and nf.

Referenced by ASMs1DC1::constrainEndLocal(), ASMs2DIB::generateFEMTopology(), ASMu2DIB::generateFEMTopology(), and prescribe().

◆ getBoundary1Nodes()

virtual void ASMbase::getBoundary1Nodes ( int  lIndex,
IntVec nodes,
int  basis = 0,
int  orient = -1,
bool  local = false,
bool  open = false 
) const
inlinevirtual

Finds the global (or patch-local) node numbers on a patch boundary.

Parameters
[in]lIndexLocal index of the boundary edge/vertex
nodesArray of node numbers
[in]basisWhich basis to grab nodes for (for mixed methods)
[in]orientLocal orientation flag (for LR splines only)
[in]localIf true, return patch-local numbers
[in]openIf true, exclude edge end points

Reimplemented in ASMs3D, and ASMu3D.

Referenced by SIMbase::getBoundaryNodes(), and DomainDecomposition::OrientIterator::OrientIterator().

◆ getBoundaryElms()

void ASMbase::getBoundaryElms ( int  lIndex,
IntVec elms,
int  orient = -1,
bool  local = false 
) const

Finds the global (or patch-local) element numbers on a boundary.

Parameters
[in]lIndexLocal index of the boundary face/edge/vertex
[out]elmsArray of element numbers
[in]orientLocal orientation flag (for LR splines only)
[in]localIf true, return patch-local element numbers

References findBoundaryElms(), and MLGE.

◆ getBoundaryNodes()

virtual void ASMbase::getBoundaryNodes ( int  lIndex,
IntVec nodes,
int  basis = 0,
int  thick = 1,
int  orient = -1,
bool  local = false 
) const
pure virtual

Finds the global (or patch-local) node numbers on a patch boundary.

Parameters
[in]lIndexLocal index of the boundary face/edge
nodesArray of node numbers
[in]basisWhich basis to grab nodes for (for mixed methods)
[in]thickThickness of connection
[in]orientLocal orientation flag (for LR splines only)
[in]localIf true, return patch-local numbers

Implemented in ASMu2DLag, ASMu1DLag, ASMsupel, ASMs1D, ASMu2D, ASMu3D, ASMs3D, ASMs2D, ASMs3Dmx, ASMs2Dmx, and ASMu2Dmx.

Referenced by SIMbase::getBoundaryNodes(), SIMinput::getTopItemNodes(), and DomainDecomposition::OrientIterator::OrientIterator().

◆ getCoord()

virtual Vec3 ASMbase::getCoord ( size_t  inod) const
pure virtual

Returns the global coordinates for the given node.

Parameters
[in]inod1-based node index local to current patch

Implemented in ASMu3Dmx, ASMu3D, ASMu2Dmx, ASMu2D, ASMsupel, ASMs3Dmx, ASMs3DLag, ASMs3D, ASMs2Dmx, ASMs2DLag, ASMs2D, ASMs1DLag, and ASMs1D.

Referenced by addRigidCouplings(), SIMbase::getBoundaryNodes(), NodeVecFunc::getPointIndex(), mergeNodes(), DomainDecomposition::sanityCheckCorners(), updateDirichlet(), and writeLagBasis().

◆ getElementCoordinates()

virtual bool ASMbase::getElementCoordinates ( Matrix X,
int  iel,
bool  forceItg = false 
) const
pure virtual

Returns a matrix with nodal coordinates for an element.

Parameters
[out]X3 \(\times\)n-matrix, where n is the number of nodes in one element
[in]iel1-based element index local to current patch
[in]forceItgIf true, return the integration basis coordinates otherwise the geometry basis coordinates are returned

Implemented in ASMs3DLag, ASMs2DLag, ASMs1DLag, ASMsupel, ASMs1D, ASMu3D, ASMu2D, ASMs3D, and ASMs2D.

Referenced by aspectRatio(), and skewness().

◆ getElementNodes()

const IntVec & ASMbase::getElementNodes ( int  iel) const

Returns the nodal point correspondance array for an element.

Parameters
[in]iel1-based element index local to current patch

References empty(), and MNPC.

◆ getElmConnectivities()

virtual void ASMbase::getElmConnectivities ( IntMat neighs,
int  basis = ASM::INTEGRATION_BASIS 
) const
pure virtual

Calculates the matrix of element neighbour connectivities.

Parameters
[out]neighsList of element neighbors for each element
[in]basisBasis to get connectivities for

Implemented in ASMu3D, ASMu2D, ASMs3D, ASMs2D, ASMs1D, and ASMsupel.

Referenced by SIMinput::getElmConnectivities(), and globalL2projection().

◆ getElmID()

int ASMbase::getElmID ( size_t  iel) const

Returns the global element number for the given element.

Parameters
[in]iel1-based element index local to current patch

References MLGE.

Referenced by compute(), SIMgeneric::findElementContaining(), SIMoutput::preprocessResPtGroup(), and SIMinput::refine().

◆ getElmIndex()

size_t ASMbase::getElmIndex ( int  globalNum) const

Returns local 1-based index of element with given global number.

If the given node number is not present, 0 is returned.

Parameters
[in]globalNumGlobal element number

References utl::findIndex(), and MLGE.

Referenced by ASMu2DLag::addToElemSet(), ASMs2D::generateThreadGroupsFromElms(), ASMs3D::generateThreadGroupsFromElms(), ASMu2D::generateThreadGroupsFromElms(), ASMu3D::generateThreadGroupsFromElms(), ASMu1DLag::isInElementSet(), ASMu2DLag::isInElementSet(), ASMu1DLag::parseElemSet(), and ASMu2DLag::parseElemSet().

◆ getLMType()

char ASMbase::getLMType ( size_t  inod) const

Returns the type of a Lagrange multiplier node.

Parameters
[in]inod1-based node index for the Lagrange multiplier

References isLMn(), myLMs, and myLMTypes.

Referenced by DomainDecomposition::calcGlobalEqNumbers(), DomainDecomposition::calcGlobalNodeNumbers(), ASMstruct::checkThreadGroups(), getNodeType(), and DomainDecomposition::setup().

◆ getNodalCoordinates()

virtual void ASMbase::getNodalCoordinates ( Matrix X,
bool  geo = false 
) const
pure virtual

Returns a matrix with all nodal coordinates within the patch.

Parameters
[out]Xnsd \(\times\)n-matrix, where n is the number of nodes
[in]geoIf true, coordinates for the geometry basis are returned otherwise the integration basis coordinates are returned

Implemented in ASMu3D, ASMu2D, ASMsupel, ASMs3DLag, ASMs2DLag, ASMs1DLag, ASMs1D, ASMs3D, and ASMs2D.

Referenced by printNodes().

◆ getNodalDOFs()

unsigned char ASMbase::getNodalDOFs ( size_t  inod) const
virtual

Returns the number of DOFs per node.

Parameters
[in]inod1-based node index local to current patch

Reimplemented in ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, and ASMs2Dmx.

References isLMn(), isRMn(), nf, nLag, and nsd.

◆ getNodeID()

int ASMbase::getNodeID ( size_t  inod,
bool  = false 
) const
virtual

◆ getNodeIndex()

size_t ASMbase::getNodeIndex ( int  globalNum,
bool  = false 
) const
virtual

Returns local 1-based index of the node with given global number.

If the given node number is not present, 0 is returned.

Parameters
[in]globalNumGlobal node number

Reimplemented in ASMs3D, and ASMs2D.

References utl::findIndex(), and MLGN.

Referenced by SIMbase::getBoundaryNodes(), ASMs1D::isInNodeSet(), ASMs1D::parseNodeSet(), and updateDirichlet().

◆ getNodeType()

char ASMbase::getNodeType ( size_t  inod) const
virtual

Returns the classification of a node.

Parameters
[in]inod1-based node index local to current patch

Reimplemented in ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, and ASMs2Dmx.

References getLMType(), isLMn(), and nnod.

Referenced by SIMbase::extractPatchSolution(), and injectNodalVec().

◆ getNoElms()

size_t ASMbase::getNoElms ( bool  includeZeroVolElms = false,
bool  includeXElms = false 
) const

Returns the total number of elements in this patch.

Parameters
[in]includeZeroVolElmsIf true, count all the regular elements in the patch, including the zero-volume elements due to multiple knots
[in]includeXElmsIf true, include any extra-ordinary elements in the patch (contact and interface elements, but no zero-volume elements)

References MLGE, and nel.

Referenced by compute(), ASMs2DTri::evalSolution(), ASMs2DSpec::evalSolution(), ASMs3DSpec::evalSolution(), getNoRefineElms(), L2projection(), LagrangeField2D::LagrangeField2D(), LagrangeField3D::LagrangeField3D(), LagrangeFields2D::LagrangeFields2D(), LagrangeFields3D::LagrangeFields3D(), SIMinput::refine(), writeLagBasis(), and HDF5Writer::writeSIM().

◆ getNoGaussPt()

int ASMbase::getNoGaussPt ( int  p,
bool  neumann = false 
) const
protected

◆ getParameterDomain()

virtual bool ASMbase::getParameterDomain ( Real2DMat u,
IntVec corners = nullptr 
) const
pure virtual

Returns parameter values and node numbers of the domain corners.

Parameters
[out]uParameter values of the domain corners
[out]corners1-based indices of the corner nodes (optional)

Implemented in ASMs3D, ASMs2D, ASMs1D, ASMLRSpline, and ASMsupel.

Referenced by L2FuncIntegrand::evaluate(), and globalL2projection().

◆ getSolution()

bool ASMbase::getSolution ( Matrix sField,
const Vector locSol,
const IntVec nodes 
) const
virtual

Extract the primary solution field at the specified nodes.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector local to current patch
[in]nodes1-based local node numbers to extract solution for

Reimplemented in ASMu3Dmx, ASMu2Dmx, ASMs3DmxLag, ASMs3Dmx, ASMs2DmxLag, ASMs2Dmx, and ASMs1D.

References utl::matrix< T >::fillColumn(), isLMn(), MLGN, nf, utl::vector< T >::ptr(), and utl::matrix< T >::resize().

Referenced by SIMoutput::evalResults(), and ASMs1D::getSolution().

◆ globalL2projection()

bool ASMbase::globalL2projection ( Matrix sField,
const L2Integrand integrand,
bool  continuous = false,
bool  enforceEnds = false 
) const

◆ hasTimeDependentDirichlet()

bool ASMbase::hasTimeDependentDirichlet ( const std::map< int, RealFunc * > &  func,
const std::map< int, VecFunc * > &  vfunc 
)

Checks for time-dependent in-homogeneous Dirichlet conditions.

Parameters
[in]funcScalar property fields
[in]vfuncVector property fields

References dCode.

◆ injectNodalVec()

bool ASMbase::injectNodalVec ( const RealArray nodeVec,
RealArray globVec,
const IntVec madof,
int  basis = 0 
) const

Injects nodal results for this patch into the global vector.

Parameters
[in]nodeVecNodal result vector for this patch
globVecGlobal solution vector in DOF-order
[in]madofGlobal Matrix of Accumulated DOFs
[in]basisWhich basis to inject nodal values for (mixed methods)

References getNodeType(), and MLGN.

Referenced by SIMbase::injectPatchSolution().

◆ injectNodeVec()

bool ASMbase::injectNodeVec ( const RealArray nodeVec,
RealArray globVec,
unsigned char  nndof = 0,
int  basis = 0 
) const
virtual

Injects nodal results for this patch into the global vector.

Parameters
[in]nodeVecNodal result vector for this patch
globVecGlobal solution vector in DOF-order
[in]nndofNumber of DOFs per node (the default is nf)
[in]basisWhich basis to inject nodal values for (mixed methods)

Reimplemented in ASMu3Dmx, ASMu2Dmx, ASMs3Dmx, and ASMs2Dmx.

References MLGN, myLMs, and nf.

Referenced by SIMbase::injectPatchSolution(), and SIMinput::setInitialCondition().

◆ integrate() [1/3]

virtual bool ASMbase::integrate ( Integrand integrand,
GlobalIntegral glbInt,
const TimeDomain time 
)
pure virtual

Evaluates an integral over the interior patch domain.

Parameters
integrandObject with problem-specific data and methods
glbIntThe integrated quantity
[in]timeParameters for nonlinear/time-dependent simulations

Implemented in ASMu3Dmx, ASMu3D, ASMu2Dmx, ASMu2DIB, ASMu2D, ASMu2DLag, ASMs3DSpec, ASMs3DmxLag, ASMs3Dmx, ASMs3DLag, ASMs3D, ASMs2DTri, ASMs2DSpec, ASMs2DmxLag, ASMs2Dmx, ASMs2DLag, ASMs2DIB, ASMs2D, ASMs1DSpec, ASMs1DLag, ASMs1D, and ASMsupel.

Referenced by SIMbase::assembleSystem(), SIM::integrate(), and L2projection().

◆ integrate() [2/3]

virtual bool ASMbase::integrate ( Integrand integrand,
GlobalIntegral glbInt,
const TimeDomain time,
const ASM::InterfaceChecker iChk 
)
inlinevirtual

Evaluates an integral over element interfaces in the patch.

Parameters
integrandObject with problem-specific data and methods
glbIntThe integrated quantity
[in]timeParameters for nonlinear/time-dependent simulations
[in]iChkObject checking if an element interface has contributions

Reimplemented in ASMu2Dmx, ASMu2D, ASMs3Dmx, ASMs3D, ASMs2Dmx, and ASMs2D.

◆ integrate() [3/3]

virtual bool ASMbase::integrate ( Integrand integrand,
int  lIndex,
GlobalIntegral glbInt,
const TimeDomain time 
)
pure virtual

Evaluates a boundary integral over a patch face/edge.

Parameters
integrandObject with problem-specific data and methods
[in]lIndexLocal index of the boundary face/edge
glbIntThe integrated quantity
[in]timeParameters for nonlinear/time-dependent simulations

Implemented in ASMu3Dmx, ASMu3D, ASMu2Dmx, ASMu2D, ASMs3DSpec, ASMs3DmxLag, ASMs3Dmx, ASMs3DLag, ASMs3D, ASMs2DTri, ASMs2DSpec, ASMs2DmxLag, ASMs2Dmx, ASMs2DLag, ASMs2D, ASMs1DSpec, ASMs1DLag, ASMs1D, and ASMsupel.

◆ integrateEdge()

virtual bool ASMbase::integrateEdge ( Integrand integrand,
int  lEdge,
GlobalIntegral glbInt,
const TimeDomain time 
)
inlinevirtual

Evaluates a boundary integral over a patch edge.

Parameters
integrandObject with problem-specific data and methods
[in]lEdgeLocal index of the patch edge
glbIntThe integrated quantity
[in]timeParameters for nonlinear/time-dependent simulations

Reimplemented in ASMu3D, ASMs3DSpec, ASMs3DLag, and ASMs3D.

Referenced by SIMbase::assembleSystem().

◆ isElementInPartition()

bool ASMbase::isElementInPartition ( int  iel) const

Returns true if element is in process partition.

Parameters
[in]iel0-based element index local to current patch

References utl::findIndex(), and myElms.

Referenced by ASMs3Dmx::integrate(), ASMs2D::integrate(), ASMs2DLag::integrate(), ASMs2Dmx::integrate(), ASMs2DmxLag::integrate(), ASMu2D::integrate(), ASMu2Dmx::integrate(), ASMu3D::integrate(), ASMs3D::integrateEdge(), and ASMs3DLag::integrateEdge().

◆ isFixed()

bool ASMbase::isFixed ( int  node,
int  dof,
bool  all = false 
) const

Checks if the given DOFs are fixed.

Parameters
[in]nodeGlobal node number of the DOF to check
[in]dofLocal indices of the DOFs to check
[in]allReturns true only if all DOFs are fixed

References BCode, and nf.

Referenced by addLocal2GlobalCpl(), ASMs2D::constrainEdgeLocal(), and ASMs3D::constrainFaceLocal().

◆ L2projection() [1/3]

bool ASMbase::L2projection ( const std::vector< Matrix * > &  fVals,
const std::vector< FunctionBase * > &  function,
double  t = 0.0 
)

Projects explicit functions using a continuous global L2-fit.

Parameters
[out]fValsControl point values of the functions
[in]functionThe functions to project
[in]tCurrent time
Note
The implementation of this method is placed in GlbL2projector.C

References getNoElms(), getNoNodes(), integrate(), MNPC, GlbL2::pA, GlbL2::pB, GlbL2::preAssemble(), PROFILE2, GlbL2::solve(), and TimeDomain::t.

◆ L2projection() [2/3]

bool ASMbase::L2projection ( Matrix fVals,
FunctionBase function,
double  t = 0.0 
)

Projects an explicit function using a continuous global L2-fit.

Parameters
[out]fValsControl point values of the function
[in]functionThe function to project
[in]tCurrent time
Note
The implementation of this method is placed in GlbL2projector.C

References getNoElms(), getNoNodes(), integrate(), MNPC, GlbL2::pA, GlbL2::pB, GlbL2::preAssemble(), PROFILE2, GlbL2::solve(), and TimeDomain::t.

◆ L2projection() [3/3]

bool ASMbase::L2projection ( Matrix sField,
IntegrandBase integrand,
const TimeDomain time 
)

Projects the secondary solution using a continuous global L2-fit.

Parameters
[out]sFieldSecondary solution field control point values
[in]integrandObject with problem-specific data and methods
[in]timeParameters for nonlinear/time-dependent simulations

This method uses the integrate() interface to perform numerical integration of the projection matrices. It should use the same integration scheme as SIMbase::assembleSystem() and is therefore suitable for problems using internal integration point buffers (with history-dependent data, etc.) and that must be traversed in the same sequence each time.

Note
The implementation of this method is placed in GlbL2projector.C

References getNoElms(), getNoNodes(), integrate(), MNPC, GlbL2::pA, GlbL2::pB, GlbL2::preAssemble(), PROFILE2, and GlbL2::solve().

Referenced by ASMu2D::evaluate(), and ASMu3D::evaluate().

◆ makePeriodic()

void ASMbase::makePeriodic ( size_t  master,
size_t  slave,
int  dirs = 123 
)
protected

Creates periodicity constraints between two nodes in this patch.

Parameters
[in]master1-based local index of the master node
[in]slave1-based local index of the slave node to constrain
[in]dirsWhich local DOFs to constrain (1, 2, 3, 12, 23, 123)

References addPeriodicity(), collapseNodes(), utl::getDigits(), and nf.

Referenced by ASMs2D::closeBoundaries(), ASMs3D::closeBoundaries(), ASMs2DC1::closeBoundaries(), and ASMs1D::closeBoundaries().

◆ mergeAndGetAllMPCs()

void ASMbase::mergeAndGetAllMPCs ( const ASMVec model,
MPCSet allMPCs 
)
static

Computes the set of all MPC-equations over the whole model.

Parameters
[in]modelAll spline patches in the model
[out]allMPCsAll multi-point constraint equations in the model

The MPC-equations are stored distributed over the patches, based on the slave DOF of the constraint. Therefore, constraints on the interface nodes between patches (to enforce higher order regularity) may be defined on both neighboring patches. This method will also merge such multiply defined equations into a single equation.

References IFEM::cout.

Referenced by SIMbase::preprocessC().

◆ mergeNodes()

bool ASMbase::mergeNodes ( size_t  inod,
int  globalNum,
bool  verbose = true 
)

Merges a given node in this patch with a given global node.

Parameters
[in]inod1-based node index local to current patch
[in]globalNumGlobal number of the node to merge node with
[in]verboseIf true, print message on the merged nodes

References IFEM::cout, getCoord(), myMLGN, neighbors, renumberNodes(), and eig::verbose.

Referenced by collapseNodes().

◆ prescribe()

int ASMbase::prescribe ( size_t  inod,
int  dirs,
int  code,
bool  overrideD = false 
)

Constrains DOFs in the given node to the given value.

Parameters
[in]inod1-based node index local to current patch
[in]dirsWhich local DOFs to constrain (1, 2, 3, 12, 23, 123)
[in]codeIdentifier for inhomogeneous Dirichlet condition field
[in]overrideDIf true, override current Dirichlet conditions
Returns
Invalid local DOFs, or DOFs that already are constrained

References addMPC(), fix(), fixHomogeneousDirichlet, utl::getDigits(), getNodeID(), and nf.

Referenced by ASMs2D::constrainCorner(), ASMu2D::constrainCorner(), ASMs2DC1::constrainCorner(), ASMs3D::constrainCorner(), ASMs2D::constrainEdge(), ASMu2D::constrainEdge(), ASMu2DC1::constrainEdge(), ASMs2DC1::constrainEdge(), ASMs3D::constrainEdge(), ASMu3D::constrainEdge(), ASMs2D::constrainEdgeLocal(), ASMs1D::constrainEndLocal(), ASMs3D::constrainFace(), ASMu3D::constrainFace(), ASMs3D::constrainFaceLocal(), ASMs3D::constrainLine(), ASMs3D::constrainNode(), ASMs2D::constrainNode(), ASMu2D::constrainNode(), ASMs2DC1::constrainNode(), ASMs1D::constrainNode(), ASMs1DC1::constrainNode(), constrainNodes(), constrainPatch(), and constrainXnode().

◆ renumberNodes() [1/3]

int ASMbase::renumberNodes ( const ASMVec model,
std::map< int, int > &  old2new 
)
static

Renumbers all global node numbers in the entire model.

Parameters
[in]modelAll spline patches in the model
[out]old2newOld-to-new node number mapping
Returns
The number of unique nodes in the model

After the renumbering, the global node numbers are in the range [1,nNod ], where nNod is the number of unique nodes in the model. The new node numbers computed by this method preserve the relative ordering of the nodes. That is not the case when the non-static version is used.

References utl::renumber().

Referenced by SAMpatch::merge(), mergeNodes(), and SIMbase::renumberNodes().

◆ renumberNodes() [2/3]

bool ASMbase::renumberNodes ( const std::map< int, int > &  old2new,
const std::vector< int > &  new2old = {},
int  renumGN = 0,
std::map< int, int > *  degenElm = nullptr 
)

Renumbers the global node numbers referred by this patch.

Parameters
[in]old2newOld-to-new node number mapping
[in]new2oldNew-to-old node number mapping
[in]renumGNFlag for renumbering the node number array MLGN
[out]degenElmGlobal node to degenerated element number mapping

This method renumbers the global node numbers referred by the boundary condition- and multi-point constraint equation objects in the patch, according to the provided mapping old2new.

The nodes themselves (in MLGN) are assumed already to be up to date, unless renumGN is greater than zero. If renumGN equals one, all node numbers are assumed present in the old2new mapping and an error is flagged if that is not the case.

If renumGN is less than zero, the element connectivities are also updated such that that only the first instance of a duplicated node is referred.

References BCode, IFEM::cout, MLGN, mpcs, myMLGE, myMLGN, myMNPC, and utl::renumber().

◆ renumberNodes() [3/3]

int ASMbase::renumberNodes ( std::map< int, int > &  old2new,
int &  nNod 
)

Renumbers the global node numbers in this patch.

Parameters
old2newOld-to-new node number mapping
nNodNumber of unique nodes found so far
Returns
The number of renumbered nodes in this patch

After the renumbering, the global node numbers are in the range [1,nNod ], where nNod is the number of unique nodes in the model.

References MLGN, myMLGN, utl::renumber(), and shareFE.

◆ resolveMPCchains()

void ASMbase::resolveMPCchains ( const MPCSet allMPCs,
const ASMVec model,
bool  setPtrOnly = false 
)
static

Resolves (possibly multi-level) chaining in MPC-equations.

Parameters
[in]allMPCsAll multi-point constraint equations in the model
[in]modelAll spline patches in the model
[in]setPtrOnlyIf true, only set pointer to next MPC in chain

Recursive resolving of (possibly multi-level) chaining in the multi-point constraint (MPC) equations. If a master DOF in one MPC-equation is specified as a slave by another one, it is replaced by the master(s) of that other equation. Since an MPC-equation may couple nodes belonging to different patches, this method must have access to all patches in the model.

If setPtrOnly is true, the MPC-equations are not modified. Instead the pointers to the next MPC object in the chain is assigned for the master DOFs which are slaves in other MPCs.

This is used in time-dependent/nonlinear simulators where the constraint coefficients might be updated due to time variation. The resolving is then done directly in the MMCEQ/TTCC arrays of the SAM object.

See also
SAMpatch::updateConstraintEqs.

References IFEM::cout.

Referenced by SIMbase::preprocessC().

◆ searchCtrlPt()

int ASMbase::searchCtrlPt ( RealArray::const_iterator  cit,
RealArray::const_iterator  end,
const Vec3 X,
int  dimension,
double  tol = 0.001 
) const
protected

Helper method used by evalPoint to search for a control point.

Parameters
[in]cititerator of array of control point coordinates
[in]enditerator of array of control point coordinates
[in]XCoordinates of point to search for
[in]dimensionNumber of spatial dimensions of the splines object
[in]tolZero tolerance

References Vec3::equal(), and nsd.

Referenced by ASMs1D::evalPoint(), ASMs2D::evalPoint(), ASMs2Dmx::evalPoint(), ASMs3D::evalPoint(), and ASMs3Dmx::evalPoint().

◆ setNodeNumbers()

void ASMbase::setNodeNumbers ( const IntVec nodes)
virtual

Sets the global node numbers for this patch.

Parameters
[in]nodesVector of zero-based node numbers of this patch

Reimplemented in ASMs3D, and ASMs2D.

References myMLGN.

Referenced by ASMs2D::setNodeNumbers(), and ASMs3D::setNodeNumbers().

◆ setNoFields()

void ASMbase::setNoFields ( unsigned char  n)
inline

Defines the number of solution fields in the patch.

This method is used by simulators where nf is not known when the patch is constructed, e.g., it depends on the input file content. It must be invoked only before SIMbase::preprocess() is invoked.

References nf.

◆ tesselate()

virtual bool ASMbase::tesselate ( ElementBlock grid,
const int *  npe 
) const
pure virtual

Creates a standard FE model of this patch for visualization.

Parameters
[out]gridThe generated finite element grid
[in]npeNumber of visualization nodes over each knot span
Note
The number of element nodes must be set in grid on input.

Implemented in ASMu3D, ASMu2D, ASMs3D, ASMs2D, ASMs1D, ASMu2DLag, ASMu1DLag, ASMsupel, ASMs3DLag, ASMs2DTri, ASMs2DLag, and ASMs1DLag.

◆ updateCoords()

virtual bool ASMbase::updateCoords ( const Vector displ)
pure virtual

Updates the nodal coordinates for this patch.

Parameters
[in]displIncremental displacements to update the coordinates with

Implemented in ASMu3D, ASMu2D, ASMs3DLag, ASMs3D, ASMs2DLag, ASMs2D, ASMs1DLag, ASMs1D, and ASMsupel.

Referenced by compute().

◆ updateDirichlet()

bool ASMbase::updateDirichlet ( const std::map< int, RealFunc * > &  func,
const std::map< int, VecFunc * > &  vfunc,
double  time = 0.0,
const std::map< int, int > *  g2l = nullptr 
)
virtual

Updates the time-dependent in-homogeneous Dirichlet coefficients.

Parameters
[in]funcScalar property fields
[in]vfuncVector property fields
[in]timeCurrent time
[in]g2lGlobal-to-local mapping to apply to node numbers

Reimplemented in ASMu3D, ASMu2D, ASMs3D, ASMs2DC1, and ASMs2D.

References dCode, utl::findKey(), getCoord(), getNodeIndex(), and utl::Function< Arg, Result >::isZero().

Referenced by ASMs2D::updateDirichlet(), ASMs3D::updateDirichlet(), ASMu2D::updateDirichlet(), and ASMu3D::updateDirichlet().

Member Data Documentation

◆ modelSize

double ASMbase::modelSize = 1.0
static

Characteristic model size.

This quantitiy is used to scale the characteristic element sizes which are used by residual error estimates, etc., such that they always are in the range [0,1.0]. The applications have to set an appropriate value, when needed.

Referenced by ASM1D::getElementSize(), ASM2D::getElementSize(), ASM3D::getElementSize(), and SIMinput::parse().

◆ nGauss

int ASMbase::nGauss
protected

Numerical integration scheme for this patch.

A value in the range [1,10] means use that number of Gauss quadrature points in each parameter direction, regardless of polynomial order of the basis functions. If zero or negative, the number of Gauss quadrature points is set independently in each parameter direction to p+nGauss, where p is the polynomial order in that direction. If the value is set larger than 10, the number of quadrature points in each parameter direction is set to p+nGauss%10.

See also
getNoGaussPt

Referenced by ASMbase(), ASMs2DIB::generateFEMTopology(), ASMu2DIB::generateFEMTopology(), ASMs2D::getGaussPointParameters(), ASMs3D::getGaussPointParameters(), ASMu2D::getGaussPointParameters(), ASMu3D::getGaussPointParameters(), getNoBouPoints(), ASMu3D::getNoBouPoints(), getNoGaussPt(), getNoIntPoints(), ASMLRSpline::getNoIntPoints(), ASMs1DSpec::integrate(), ASMs2DTri::integrate(), ASMu2Dmx::integrate(), ASMu3Dmx::integrate(), ASMu2D::integrate(), ASMs2Dmx::integrate(), ASMs2DmxLag::integrate(), ASMs3Dmx::integrate(), ASMs3DmxLag::integrate(), ASMs2DIB::isIntersected(), and setGauss().

◆ shareFE

const char ASMbase::shareFE
protected

Flag telling whether this patch shares its data with another patch.

'S' means this patch uses spline geometry of another patch. 'F' means this patch uses FE data and spline geometry of another patch. If true, this patch uses FE data of another patch

Referenced by ASMs2D::addInterfaceElms(), addLagrangeMultipliers(), ASMstruct::addXNodes(), ASMs2D::assignNodeNumbers(), ASMs2D::checkRightHandSystem(), ASMs3D::checkRightHandSystem(), clear(), ASMu2D::clear(), ASMu3D::clear(), ASMs1D::connectBasis(), ASMs2DC1::connectC1(), ASMs2D::constrainEdgeLocal(), ASMs1D::constrainEndLocal(), ASMs1DC1::constrainEndLocal(), ASMs3D::constrainFaceLocal(), ASMu2D::cornerRefine(), ASMu2D::diagonalRefine(), ASMs2DLag::evalSolution(), ASMs2Dmx::generateFEMTopology(), ASMs2DmxLag::generateFEMTopology(), ASMs3D::generateFEMTopology(), ASMs3Dmx::generateFEMTopology(), ASMs3DmxLag::generateFEMTopology(), ASMu2D::generateFEMTopology(), ASMu2Dmx::generateFEMTopology(), ASMu3D::generateFEMTopology(), ASMu3Dmx::generateFEMTopology(), isShared(), ASMs1D::raiseOrder(), ASMs2D::raiseOrder(), ASMu2D::raiseOrder(), ASMu3D::raiseOrder(), ASMs3D::raiseOrder(), ASMs1D::read(), ASMs2D::read(), ASMs3D::read(), ASMu2D::read(), ASMu3D::read(), ASMs1D::refine(), ASMu2Dmx::refine(), ASMu3Dmx::refine(), ASMs3D::refine(), ASMu3D::refine(), ASMu2D::refine(), ASMs2D::refine(), renumberNodes(), ASMs2D::uniformRefine(), ASMs3D::uniformRefine(), ASMu3D::uniformRefine(), ASMu2D::uniformRefine(), ASMs1D::uniformRefine(), ASMs1D::updateCoords(), ASMs1DLag::updateCoords(), ASMs2D::updateCoords(), ASMs2DLag::updateCoords(), ASMs3D::updateCoords(), ASMs3DLag::updateCoords(), ASMs1D::updateRotations(), and ASMs2D::~ASMs2D().


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