IFEM  90A354
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ASMu2DLag Class Reference

Driver for assembly of unstructured 2D Lagrange FE models. More...

#include <ASMu2DLag.h>

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

Classes

class  BasisFunctionCache
 Implementation of basis function cache. More...
 

Public Member Functions

 ASMu2DLag (unsigned char n=2, unsigned char n_f=2, char fType='m')
 Default constructor.
 
 ASMu2DLag (const ASMu2DLag &pch, unsigned char n_f)
 Special copy constructor for sharing of FE data.
 
 ASMu2DLag (const ASMu2DLag &pch)
 Default copy constructor copying everything.
 
virtual ~ASMu2DLag ()
 Empty destructor.
 
virtual bool read (std::istream &is)
 Creates an instance by reading the given input stream.
 
virtual bool generateFEMTopology ()
 Generates the finite element topology data for the patch.
 
virtual bool empty () const
 Checks if this patch is empty.
 
virtual int getNodeSetIdx (const std::string &setName) const
 Returns (1-based) index of a predefined node set in the patch.
 
virtual const IntVecgetNodeSet (int iset) const
 Returns an indexed predefined node set.
 
virtual bool isInNodeSet (int iset, int inod) const
 Checks if node inod is within predefined node set iset. More...
 
virtual int parseNodeSet (const std::string &setName, const char *cset)
 Defines a node set by parsing a list of node numbers.
 
virtual int parseNodeBox (const std::string &setName, const char *bbox)
 Defines a node set by parsing a 3D bounding box.
 
int addToNodeSet (const std::string &setName, int inod, bool extId=false)
 Adds a node to a named node set. More...
 
bool getNodeSet (int iset, std::string &name) const
 Returns the name of an indexed predefined node set.
 
virtual int getElementSetIdx (const std::string &setName) const
 Returns (1-based) index of a predefined element set in the patch.
 
virtual const IntVecgetElementSet (int iset) const
 Returns an indexed predefined element set.
 
virtual bool getElementSet (int iset, std::string &name) const
 Returns the name of an indexed predefined element set.
 
virtual bool isInElementSet (int iset, int iel) const
 Checks if element iel is within predefined element set iset. More...
 
virtual int parseElemSet (const std::string &setName, const char *cset)
 Defines an element set by parsing a list of element numbers.
 
virtual int parseElemBox (const std::string &setName, const std::string &unionSet, const char *bbox)
 Defines an element set by parsing a 3D bounding box.
 
int addToElemSet (const std::string &setName, int iel, bool extId=false)
 Adds an element to a named element set. More...
 
virtual void getBoundaryNodes (int lIndex, IntVec &nodes, int, int, int, bool local) const
 Finds the global (or patch-local) node numbers on a patch boundary. More...
 
virtual bool integrate (Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates an integral over the interior patch domain. More...
 
virtual void generateThreadGroups (const Integrand &, bool silence, bool separateGroup1noded)
 Generates element groups for multi-threading of interior integrals.
 
virtual bool tesselate (ElementBlock &grid, const int *) const
 Creates a quad element model of this patch for visualization. More...
 
bool writeXML (const char *fname) const
 Dumps the mesh to the specified XML-file.
 
virtual bool integrate (Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates an integral over the interior patch domain. More...
 
virtual bool integrate (Integrand &integrand, int lIndex, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates a boundary integral over a patch edge. More...
 
virtual void generateThreadGroups (const Integrand &, bool, bool)
 Generates element groups for multi-threading of interior integrals.
 
virtual void generateThreadGroups (const Integrand &integrand, bool silence, bool ignoreGlobalLM)
 Generates element groups for multi-threading of interior integrals. More...
 
void generateThreadGroups (size_t strip1, size_t strip2, bool silence, bool ignoreGlobalLM)
 Generates element groups for multi-threading of interior integrals. More...
 
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.
 
- Public Member Functions inherited from ASMs2DLag
 ASMs2DLag (unsigned char n_s=2, unsigned char n_f=2)
 Default constructor.
 
 ASMs2DLag (const ASMs2DLag &patch, unsigned char n_f)
 Special copy constructor for sharing of FE data.
 
 ASMs2DLag (const ASMs2DLag &patch)
 Default copy constructor copying everything.
 
virtual ~ASMs2DLag ()
 Empty destructor.
 
virtual bool write (std::ostream &os, int=0) const
 Writes the FEM basis to given stream.
 
virtual void clear (bool retainGeometry=false)
 Clears the contents of the 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...
 
virtual bool getElementCoordinates (Matrix &X, int iel, bool=true) const
 Returns a matrix with nodal coordinates for an element. More...
 
virtual void getNodalCoordinates (Matrix &X, bool=false) const
 Returns a matrix with all nodal coordinates within the patch. More...
 
virtual Vec3 getCoord (size_t inod) const
 Returns the global coordinates for the given node. More...
 
virtual Vec3 getElementCenter (int iel) const
 Returns the geometric center of an element.
 
virtual void constrainEdge (int dir, bool open, int dof, int code, char basis)
 Constrains all DOFs on a given boundary edge. More...
 
virtual size_t getNoProjectionNodes () const
 Returns the number of projection nodes for this patch.
 
virtual bool assembleL2matrices (SystemMatrix &A, SystemVector &B, const L2Integrand &integrand, bool continuous) const
 Assembles L2-projection matrices for the secondary solution. More...
 
virtual bool updateCoords (const Vector &displ)
 Updates the nodal coordinates for this patch. More...
 
virtual bool integrate (Integrand &integrand, int lIndex, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates a boundary integral over a patch edge. More...
 
virtual int evalPoint (const double *xi, double *param, Vec3 &X) const
 Evaluates the geometry at a specified point. More...
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const int *, int n_f, bool) const
 Evaluates the primary solution field at all visualization points. More...
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const RealArray *gpar, bool regular, int, int) const
 Evaluates the primary solution field at the given points. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const int *, char) const
 Evaluates the secondary solution field at all visualization points. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const RealArray *gpar, bool regular) const
 Evaluates the secondary solution field at the given points. More...
 
virtual bool evaluate (const ASMbase *basis, const Vector &locVec, RealArray &vec, int basisNum) const
 Evaluates and interpolates a field over a given geometry. More...
 
virtual bool getOrder (int &pu, int &pv, int &pw) const
 Returns the polynomial order in each parameter direction. More...
 
virtual bool getSize (int &n1, int &n2, int=0) const
 Returns the number of nodal points in each parameter direction. More...
 
virtual IntMat getElmNodes (int basis) const
 Returns the matrix of nodal point correspondance for given basis.
 
virtual size_t getNoBoundaryElms (char lIndex, char ldim) const
 Returns the number of elements on a boundary.
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const int *npe, int n_f, bool piola) const
 Evaluates the primary 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=0) const
 Evaluates the primary solution field at the given points. 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 Go::GeomObject * evalSolution (const IntegrandBase &integrand) const
 Projects the secondary solution field onto the primary basis. 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 getSize (int &n1, int &n2, int basis=0) const
 Returns the number of nodal points in each parameter direction. More...
 
virtual bool getSize (int &n1, int &n2, int &n3, int basis) const
 Returns the number of nodal points in each parameter direction. More...
 
virtual void generateThreadGroups (const Integrand &integrand, bool silence, bool ignoreGlobalLM)
 Generates element groups for multi-threading of interior integrals. More...
 
void generateThreadGroups (size_t strip1, size_t strip2, bool silence, bool ignoreGlobalLM)
 Generates element groups for multi-threading of interior integrals. More...
 
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.
 
- Public Member Functions inherited from ASMs2D
 ASMs2D (unsigned char n_s=2, unsigned char n_f=2)
 Default constructor.
 
 ASMs2D (const ASMs2D &patch, unsigned char n_f)
 Special copy constructor for sharing of FE data.
 
 ASMs2D (const ASMs2D &patch)
 Default copy constructor copying everything.
 
virtual ~ASMs2D ()
 The destructor frees the dynamically allocated boundary curves.
 
virtual Go::SplineCurve * getBoundary (int dir, int=1)
 Returns the spline curve representing a boundary of this patch. More...
 
virtual Go::SplineSurface * getBasis (int basis=1)
 Returns the spline surface representing a basis of this patch.
 
virtual const Go::SplineSurface * getBasis (int basis=1) const
 Returns the spline surface representing a basis of this patch.
 
virtual void copyParameterDomain (const ASMbase *other)
 Copies the parameter domain from the other patch.
 
bool addInterfaceElms (const ASM::InterfaceChecker &iChk)
 Adds interface elements with coupling to all element DOFs. More...
 
virtual size_t getNodeIndex (int globalNum, bool noAddedNodes=false) const
 Returns local 1-based index of the node with given global number. More...
 
virtual int getNodeID (size_t inod, bool noAddedNodes=false) const
 Returns the global node number for the given node. More...
 
virtual int getCorner (int I, int J, int basis) const
 Returns the node index for a given corner. More...
 
bool assignNodeNumbers (BlockNodes &nodes, int basis=0)
 Assigns new global node numbers for all nodes of the patch. More...
 
virtual bool checkRightHandSystem ()
 Checks that the patch is modelled in a right-hand-side system. More...
 
virtual bool refine (int dir, const RealArray &xi, double scale=1.0)
 Refines the parametrization by inserting extra knots. More...
 
virtual bool uniformRefine (int dir, int nInsert)
 Refines the parametrization by inserting extra knots uniformly. More...
 
virtual bool raiseOrder (int ru, int rv)
 Raises the order of the SplineSurface object for this patch. More...
 
virtual bool createProjectionBasis (bool init)
 Creates a separate projection basis for this patch. More...
 
virtual bool separateProjectionBasis () const
 Checks if a separate projection basis is used for this patch.
 
virtual size_t constrainEdgeLocal (int dir, bool open, int dof, int code, bool project=false)
 Constrains all DOFs in local directions on a given boundary edge. More...
 
virtual void constrainCorner (int I, int J, int dof, int code=0, char basis=1)
 Constrains a corner node identified by the two parameter indices. More...
 
virtual void constrainNode (double xi, double eta, int dof, int code=0)
 Constrains a node identified by two relative parameter values. More...
 
virtual bool connectPatch (int edge, ASM2D &neighbor, int nedge, bool revers, int=0, bool coordCheck=true, int thick=1)
 Connects all matching nodes on two adjacent boundary edges. More...
 
virtual void closeBoundaries (int dir, int basis, int master)
 Makes two opposite boundary edges periodic. More...
 
virtual bool collapseEdge (int dir, int basis=1)
 Collapses a degenereated edge into a single node. More...
 
virtual bool addRigidCpl (int lindx, int ldim, int basis, int &gMaster, const Vec3 &Xmaster, bool extraPt)
 Adds MPCs representing a rigid coupling to this patch. More...
 
virtual void setNodeNumbers (const IntVec &nodes)
 Sets the global node numbers for this patch. More...
 
virtual bool updateDirichlet (const std::map< int, RealFunc * > &func, const std::map< int, VecFunc * > &vfunc, double time, const std::map< int, int > *g2l=nullptr)
 Updates the time-dependent in-homogeneous Dirichlet coefficients. 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 int findElementContaining (const double *param) const
 Returns the element that contains a specified spatial point. More...
 
virtual double findPoint (Vec3 &X, double *param) const
 Searches for the specified Cartesian point in the patch. More...
 
virtual bool getGridParameters (RealArray &prm, int dir, int nSegSpan) const
 Calculates parameter values for visualization nodal points. More...
 
virtual bool evalProjSolution (Matrix &sField, const Vector &locSol, const int *npe, int n_f) const
 Evaluates the projected solution field at all visualization points. More...
 
virtual bool evaluate (const Field *field, RealArray &vec, int basisNum) const
 Evaluates and interpolates a field over a given geometry. More...
 
virtual bool evaluate (const FunctionBase *func, RealArray &vec, int basisNum, double time) const
 Evaluates and interpolates a function over a given geometry. More...
 
virtual Go::GeomObject * evalSolution (const IntegrandBase &integrand) const
 Projects the secondary solution field onto the primary basis. More...
 
virtual bool getSize (int &n1, int &n2, int &n3, int basis) const
 Returns the number of nodal points in each parameter direction. More...
 
virtual bool getNoStructElms (int &n1, int &n2, int &n3) const
 Returns the number of elements in each parameter direction. More...
 
virtual void getElmConnectivities (IntMat &neigh, int basis=ASM::INTEGRATION_BASIS) const
 Calculates the matrix of element neighbour connectivities. More...
 
virtual size_t getNoNodes (int basis=0) const
 Returns the total number of nodes in this patch.
 
virtual bool getParameterDomain (Real2DMat &u, IntVec *corners) const
 Returns parameter values and node numbers of the domain corners. More...
 
virtual void evaluateBasis (double u, double v, double, Vector &N) const
 Evaluates the basis functions at the specified point. More...
 
void extractBasis (double u, double v, Vector &N, Matrix &dNdu, bool fromRight=true) const
 Establishes matrices with basis functions and 1st derivatives. More...
 
void extractBasis (double u, double v, Vector &N, Matrix &dNdu, Matrix3D &d2Ndu2, bool fromRight=true) const
 Establishes matrices with basis functions, 1st and 2nd derivatives. More...
 
void extractBasis (double u, double v, int dir, int p, Vector &dN, bool fromRight=true) const
 Establishes a vector with basis function derivatives. More...
 
virtual FieldgetProjectedField (const Vector &coefs) const
 Returns a field using the projection basis. More...
 
virtual FieldsgetProjectedFields (const Vector &coefs, size_t=0) const
 Returns a field using the projection basis. More...
 
- Public Member Functions inherited from ASMstruct
virtual ~ASMstruct ()
 The destructor frees the dynamically allocated spline objects.
 
virtual bool diracPoint (Integrand &integr, GlobalIntegral &glInt, const double *u, const Vec3 &pval)
 Integrates a spatial dirac-delta function over a patch. More...
 
virtual void swapProjectionBasis ()
 Swaps between the first and second projection basis.
 
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 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 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...
 
- Public Member Functions inherited from ASMbase
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 readBasis (std::istream &, size_t)
 Reads a basis from the given input 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.
 
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.
 
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 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 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.
 
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.
 
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.
 
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.
 
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 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 (char, bool, bool)
 Generates element groups for multi-threading of boundary integrals.
 
virtual bool integrateEdge (Integrand &integrand, int lEdge, GlobalIntegral &glbInt, const TimeDomain &time)
 Evaluates a boundary integral over a patch edge. 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 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 evalSolutionPiola (Matrix &sField, const Vector &locSol, const RealArray *gpar, bool regular) const
 Evaluates the primary solution field with Piola mapping. 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 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 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...
 
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...
 
- Public Member Functions inherited from ASM2D
virtual ~ASM2D ()
 Empty destructor.
 
ASMbaseclone (const CharVec &nf=CharVec()) const
 Returns a copy of this patch with identical FE discretization. More...
 
virtual bool refine (int dir, const std::vector< double > &xi, double scale=1.0)=0
 Refines the parametrization by inserting extra knots. More...
 
virtual bool getGridParameters (std::vector< double > &prm, int dir, int nSegSpan) const =0
 Calculates parameter values for visualization nodal points. More...
 

Protected Member Functions

virtual bool evalSolPt (int iel, double xi, double eta, size_t nCmp, const Vector &pchSol, RealArray &ptSol, RealArray &N) const
 Evaluates a nodal solution field at specified point in an element. More...
 
void generateThreadGroupsMultiColored (bool silence, bool separateGroup1Noded)
 Generate thread groups using multi-coloring.
 
- Protected Member Functions inherited from ASMs2DLag
void setCoord (size_t inod, const Vec3 &Xnod)
 Assigned global coordinates for the given node. More...
 
virtual void findBoundaryElms (IntVec &elms, int lIndex, int=0) const
 Finds the patch-local element numbers on a patch boundary. More...
 
int findElement (double u, double v, double *xi=nullptr, double *eta=nullptr) const
 Finds the element containing specified parametric point. More...
 
bool integrateElm (Integrand &integrand, GlobalIntegral &glbInt, int iel, ASMs2D::BasisFunctionCache &cache, const TimeDomain &time)
 Evaluates an integral over an interior element domain. More...
 
- Protected Member Functions inherited from ASMs2D
bool integrate (Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time, const Real3DMat &itgPts)
 Evaluates an integral over the interior patch domain. More...
 
bool connectBasis (int edge, ASMs2D &neighbor, int nedge, bool revers, int basis=1, int slave=0, int master=0, bool coordCheck=true, int thick=1)
 Connects all matching nodes on two adjacent boundary edges. More...
 
void getGaussPointParameters (RealArray &uGP, int dir, int nGauss, const double *xi) const
 Extracts parameter values of the Gauss points in one direction. More...
 
bool getGrevilleParameters (RealArray &prm, int dir, int basisNum=1) const
 Calculates parameter values for the Greville points. More...
 
bool getQuasiInterplParameters (RealArray &prm, int dir) const
 Calculates parameter values for the Quasi-Interpolation points. More...
 
double getParametricArea (int iel) const
 Returns the area in the parameter space for an element. More...
 
double getParametricLength (int iel, int dir) const
 Returns boundary edge length in the parameter space for an element. More...
 
bool getElementCoordinatesPrm (Matrix &X, double u, double v) const
 Returns a matrix with nodal coordinates for element containing given parameters. More...
 
void getElementBorders (int i1, int i2, double *u, double *v) const
 Computes the element border parameters. More...
 
virtual void getElementBorders (int iel, double *u) const
 Computes the element border parameters. More...
 
double getElementCorners (int i1, int i2, std::vector< Vec3 > &XC, RealArray *uC=nullptr) const
 Computes the element corner coordinates. More...
 
void getCornerPoints (int i1, int i2, std::vector< utl::Point > &XC) const
 Computes the element corner coordinates and parameters. More...
 
virtual void changeNumThreads ()
 Hook for changing number of threads.
 
void generateThreadGroups (size_t strip1, size_t strip2, bool silence, bool ignoreGlobalLM)
 Generates element groups for multi-threading of interior integrals. More...
 
virtual void generateThreadGroupsFromElms (const IntVec &elms)
 Generates element groups from a partition.
 
virtual void generateProjThreadGroupsFromElms (const IntVec &elms)
 Generate element groups from a partition.
 
virtual bool validateThreadGroups (const SAM *sam) const
 Validates the threading groups based on the assembly data in SAM.
 
virtual int getFirstItgElmNode () const
 Returns 0-based index of first node on integration basis.
 
virtual int getLastItgElmNode () const
 Returns 0-based index of last node on integration basis.
 
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.
 
- Protected Member Functions inherited from ASMstruct
 ASMstruct (unsigned char n_p, unsigned char n_s, unsigned char n_f)
 The constructor sets the number of space dimensions and fields. More...
 
 ASMstruct (const ASMstruct &patch, unsigned char n_f)
 Special copy constructor for sharing of FE data. More...
 
bool addXNodes (unsigned short int dim, size_t nXn, IntVec &nodes)
 Adds extraordinary nodes associated with a patch boundary. More...
 
bool checkThreadGroups (const std::vector< std::set< int >> &nodes, int group, bool ignoreGlobalLM)
 Performs a sanity check on the thread groups. More...
 
- Protected Member Functions inherited from ASMbase
 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...
 
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.
 
- Protected Member Functions inherited from ASM2D
 ASM2D ()
 The constructor is protected to allow objects of sub-classes only.
 
- Protected Member Functions inherited from ASMLagBase
 ASMLagBase ()
 Default constructor.
 
 ASMLagBase (const ASMLagBase &patch, bool cpCoord=true)
 Copy constructor.
 
virtual ~ASMLagBase ()
 Empty destructor.
 
bool nodalField (Matrix &field, const Vector &sol, size_t nno) const
 Direct nodal evaluation of a solution field.
 
Vec3 getGeometricCenter (const std::vector< int > &MNPC) const
 Returns the geometric center of an element.
 
bool updateCoords (const Vector &displ, unsigned char nsd)
 Updates the nodal coordinates for this patch. More...
 
void updateOrigin (const Vec3 &origin)
 Updates patch origin by adding a constant to all nodes. More...
 

Protected Attributes

bool swapNode34
 If true, element nodes 3 and 4 should be swapped.
 
std::vector< ASM::NodeSetnodeSets
 Node sets for Dirichlet BCs.
 
std::vector< ASM::NodeSetelemSets
 Element sets for properties.
 
- Protected Attributes inherited from ASMs2DLag
size_t nx
 Number of nodes in first parameter direction.
 
size_t ny
 Number of nodes in second parameter direction.
 
int p1
 Polynomial order in first parameter direction.
 
int p2
 Polynomial order in second parameter direction.
 
- Protected Attributes inherited from ASMs2D
std::shared_ptr< Go::SplineSurface > surf
 The actual spline surface object.
 
Go::SplineCurve * bou [4]
 Pointers to the four boundary curves.
 
bool swapV
 Has the v-parameter direction been swapped?
 
const IndexVecnodeInd
 IJ-pairs for the control points (nodes)
 
IndexVec myNodeInd
 The actual IJ-pair container.
 
std::map< size_t, size_t > xnMap
 Node index map used by getCoord()
 
std::map< size_t, size_t > nxMap
 Node index map used by getNodeID()
 
std::vector< DirichletEdgedirich
 Inhomogeneous Dirichlet boundary condition data.
 
ThreadGroups threadGroups
 Element groups for multi-threaded assembly.
 
std::vector< std::unique_ptr< BasisFunctionCache > > myCache
 Basis function cache.
 
- Protected Attributes inherited from ASMstruct
std::shared_ptr< Go::GeomObject > geomB
 Pointer to spline object of the geometry basis.
 
std::shared_ptr< Go::GeomObject > projB
 Pointer to spline object of the projection basis.
 
std::shared_ptr< Go::GeomObject > projB2
 Pointer to spline object of the secondary projection basis.
 
ThreadGroups projThreadGroups
 Element groups for multi-threaded assembly - projection basis.
 
ThreadGroups proj2ThreadGroups
 Element groups for multi-threaded assembly - second projection basis.
 
- Protected Attributes inherited from ASMbase
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.
 
- Protected Attributes inherited from ASMLagBase
const Vec3Veccoord
 Const reference to the nodal coordinate container.
 
Vec3Vec myCoord
 Nodal coordinate container.
 

Private Attributes

char fileType
 Mesh file format.
 

Additional Inherited Members

- Public Types inherited from ASMbase
using BCVec = std::vector< BC >
 Nodal boundary condition container.
 
- Public Types inherited from ASM2D
typedef std::vector< unsigned char > CharVec
 Convenience type.
 
- Static Public Member Functions inherited from ASMs2D
static void scatterInd (int n1, int n2, int p1, int p2, const int *start, IntVec &index)
 Auxilliary function for computation of basis function indices.
 
- Static Public Member Functions inherited from ASMbase
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...
 
- Static Public Member Functions inherited from ASM2D
static ASMbasecreate (ASM::Discretization type, unsigned char nd, const CharVec &nf, bool mixedFEM=false)
 Creates a two-parametric patch of specified discretization type. More...
 
static ASMbasecreate (ASM::Discretization type, unsigned char nf=1)
 Creates a two-parametric patch of specified discretization type. More...
 
- Public Attributes inherited from ASMbase
size_t idx
 Index of this patch in the multi-patch model.
 
- Static Public Attributes inherited from ASMbase
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 inherited from ASMbase
using XYZ = std::array< double, 3 >
 Convenience type definition.
 
- Static Protected Member Functions inherited from ASMbase
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...
 
- Static Protected Member Functions inherited from ASM2D
static double getElementSize (const std::vector< Vec3 > &XC)
 Returns characteristic element size based on corner coordinates.
 
- Static Protected Attributes inherited from ASMbase
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.
 

Detailed Description

Driver for assembly of unstructured 2D Lagrange FE models.

This class overrides the methods of its parent class such that it does not depend on a surface spline object for geometry discretization. It can therefore be used for any unstructured grid read from mesh files.

Member Function Documentation

◆ addToElemSet()

int ASMu2DLag::addToElemSet ( const std::string &  setName,
int  iel,
bool  extId = false 
)

Adds an element to a named element set.

Parameters
[in]setNameName of the element set to receive the element
[in]ielIdentifier of the element to add to the set
[in]extIdIf true, iel is the external element Id, otherwise it is a one-based internal element index
Returns
Element set index associated with setName

References IFEM::cout, elemSets, getElementSetIdx(), ASMbase::getElmIndex(), and ASMbase::nel.

◆ addToNodeSet()

int ASMu2DLag::addToNodeSet ( const std::string &  setName,
int  inod,
bool  extId = false 
)

Adds a node to a named node set.

Parameters
[in]setNameName of the node set to receive the node
[in]inodIdentifier of the node to add to the set
[in]extIdIf true, inod is the external node Id, otherwise it is a one-based internal node index
Returns
Node set index associated with setName

References IFEM::cout, ASMs2D::getNodeIndex(), getNodeSetIdx(), ASMbase::nnod, and nodeSets.

◆ evalSolPt()

bool ASMu2DLag::evalSolPt ( int  iel,
double  xi,
double  eta,
size_t  nCmp,
const Vector pchSol,
RealArray ptSol,
RealArray N 
) const
protectedvirtual

Evaluates a nodal solution field at specified point in an element.

Parameters
[in]iel1-based element index local to current patch
[in]xiFirst parametric coordinate in range [-1,1]
[in]etaSecond parametric coordinate in range [-1,1]
[in]nCmpNumber of solution components
[in]pchSolNodal values of the field to evaluate
[out]ptSolSolution field values at the specified point
[out]NBasis function values at the sepcified point

If iel is negative, it is assumed that the basis function values aready have been evaluated in N, and the ξ and η parameters are not used. If iel is positive, the basis functions are evaluated at point ξ,η. The 4-noded elements are handled by forwarding to the parent class method. The 3-noded elements (linear triangles) are handled separately by setting up a temporary basis function array N3 and not touching the incoming N. This method will ignore elements with less than 3 nodes (ptSol is empty).

Reimplemented from ASMs2DLag.

References ASMs2DLag::evalSolPt(), and ASMbase::MNPC.

◆ generateThreadGroups() [1/2]

void ASMs2D::generateThreadGroups

Generates element groups for multi-threading of interior integrals.

Parameters
[in]integrandObject with problem-specific data and methods
[in]silenceIf true, suppress threading group outprint
[in]ignoreGlobalLMSanity check option

◆ generateThreadGroups() [2/2]

void ASMs2D::generateThreadGroups

Generates element groups for multi-threading of interior integrals.

Parameters
[in]strip1Strip width in first direction
[in]strip2Strip width in second direction
[in]silenceIf true, suppress threading group outprint
[in]ignoreGlobalLMSanity check option

Lamba for setting up thread groups for basis.

◆ getBoundaryNodes()

void ASMu2DLag::getBoundaryNodes ( int  lIndex,
IntVec nodes,
int  ,
int  ,
int  ,
bool  local 
) const
virtual

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

Parameters
[in]lIndexLocal index of the boundary node set
nodesArray of node numbers
[in]localIf true, return patch-local numbers

Reimplemented from ASMs2D.

References ASMs2D::getNodeID(), and getNodeSet().

◆ integrate() [1/3]

bool ASMs2DLag::integrate

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

◆ integrate() [2/3]

bool ASMu2DLag::integrate ( Integrand integrand,
GlobalIntegral glbInt,
const TimeDomain time 
)
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

Reimplemented from ASMs2DLag.

References ASM::cachePolicy, BasisFunctionCache< Dim >::clear(), empty(), Integrand::getIntegrandType(), BasisFunctionCache< Dim >::init(), ASMs2DLag::integrateElm(), ASMs2D::myCache, ASMbase::myElms, ASMbase::nel, Integrand::NO_DERIVATIVES, ThreadGroups::oneStripe(), ASM::PRE_CACHE, BasisFunctionCache< Dim >::setIntegrand(), ASMs2D::threadGroups, and GlobalIntegral::threadSafe().

◆ integrate() [3/3]

bool ASMs2DLag::integrate

Evaluates a boundary integral over a patch edge.

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

◆ isInElementSet()

bool ASMu2DLag::isInElementSet ( int  iset,
int  iel 
) const
virtual

Checks if element iel is within predefined element set iset.

If iel is negative, the absolute value is taken as the external element ID. Otherwise, it is taken as the 1-based internal element index within the patch.

Reimplemented from ASMbase.

References elemSets, utl::findIndex(), and ASMbase::getElmIndex().

Referenced by parseElemBox().

◆ isInNodeSet()

bool ASMu2DLag::isInNodeSet ( int  iset,
int  inod 
) const
virtual

Checks if node inod is within predefined node set iset.

If inod is negative, the absolute value is taken as the external node ID. Otherwise, it is taken as the 1-based internal node index within the patch.

Reimplemented from ASMbase.

References utl::findIndex(), ASMs2D::getNodeIndex(), and nodeSets.

◆ tesselate()

bool ASMu2DLag::tesselate ( ElementBlock grid,
const int *   
) const
virtual

Creates a quad element model of this patch for visualization.

Parameters
[out]gridThe generated quadrilateral grid
Note
The number of element nodes must be set in grid on input.

Reimplemented from ASMs2DLag.

References ElementBlock::endOfElm(), ASMbase::MLGE, ASMbase::MNPC, ASMbase::nel, ASMbase::nnod, ElementBlock::setCoor(), ElementBlock::setElmId(), ElementBlock::setNode(), swapNode34, and ElementBlock::unStructResize().


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