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

Driver for assembly of structured 1D spline FE models. More...

#include <ASMs1D.h>

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

Public Member Functions

 ASMs1D (unsigned char n_s=1, unsigned char n_f=1)
 Default constructor.
 
 ASMs1D (const ASMs1D &patch, unsigned char n_f=0)
 Copy constructor.
 
virtual ~ASMs1D ()
 Empty destructor.
 
Go::SplineCurve * getCurve () const
 Returns the spline curve representing the geometry of this patch.
 
virtual bool read (std::istream &)
 Creates an instance by reading the given input stream.
 
virtual bool write (std::ostream &, int=0) const
 Writes the geometry of the SplineCurve object to given stream.
 
virtual bool generateFEMTopology ()
 Generates the finite element topology data for the patch. More...
 
virtual bool generateOrientedFEModel (const Vec3 &Zaxis)
 Generates a beam finite element model for the patch. More...
 
void applyTwist (const RealFunc &twist)
 Applies a twist angle to the beam transformation matrices. More...
 
virtual void clear (bool retainGeometry=false)
 Clears the contents of the patch, making it empty. More...
 
virtual int getSize (int=0) const
 Returns the number of nodal points in the patch.
 
virtual Vec3 getCoord (size_t inod) const
 Returns the global coordinates for the given node. More...
 
const TensorgetRotation (size_t inod) const
 Returns the current rotation tensor for the given node. More...
 
virtual bool getElementCoordinates (Matrix &X, int iel, bool=false) 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 bool updateCoords (const Vector &displ)
 Updates the nodal coordinates for this patch. More...
 
bool updateRotations (const Vector &displ, bool reInit=false)
 Updates the nodal rotations for this patch. More...
 
void updateRotations ()
 Updates the previous nodal rotations for this patch at convergence.
 
virtual Vec3 getElementCenter (int iel) const
 Returns the coordinate of the element center.
 
virtual void getBoundaryNodes (int lIndex, IntVec &nodes, int, int thick, int, bool local) const
 Finds the global (or patch-local) node number on a patch end. More...
 
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 pre-defined 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 std::pair< size_t, double > findClosestNode (const Vec3 &X) const
 Finds the node that is closest to the given point. More...
 
std::pair< int, double > findElement (const Vec3 &X) const
 Finds the element that contains the given point. More...
 
virtual bool refine (const LR::RefineData &prm, Vectors &)
 Refines the mesh adaptively. More...
 
virtual bool refine (const RealArray &xi)
 Refines the parametrization by inserting extra knots. More...
 
virtual bool uniformRefine (int nInsert)
 Refines the parametrization by inserting extra knots uniformly. More...
 
virtual bool raiseOrder (int ru)
 Raises the order of the SplineCurve object for this patch. More...
 
virtual bool createProjectionBasis (bool init)
 Creates a separate projection basis for this patch. More...
 
virtual int constrainNode (double xi, int dof, int code)
 Constrains a node identified by a relative parameter value. More...
 
virtual size_t constrainEndLocal (int dir, int dof, int code)
 Constrains all DOFs in local directions at a given end point. More...
 
virtual bool connectPatch (int vertex, ASM1D &neighbor, int nvertex, int thick=1)
 Connects matching nodes on two adjacent vertices. More...
 
virtual void closeBoundaries (int, int basis, int master)
 Makes the two end vertices of the curve periodic. More...
 
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 end. More...
 
virtual int evalPoint (const double *xi, double *param, Vec3 &X) const
 Evaluates the geometry at a specified point. 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 tesselate (ElementBlock &grid, const int *npe) const
 Creates a line element model of this patch for visualization. More...
 
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, bool) const
 Evaluates the primary solution field at all visualization points. More...
 
virtual bool evalSolution (Matrix &sField, const Vector &locSol, const RealArray *gpar, bool=true, int deriv=0, int=0) const
 Evaluates the primary solution field at the given points. More...
 
virtual bool evalProjSolution (Matrix &sField, const Vector &locSol, const int *npe, int) const
 Evaluates the projected solution field at all visualization points. More...
 
virtual bool evaluate (const FunctionBase *func, RealArray &vec, int, double time) const
 Evaluates and interpolates a 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...
 
Go::SplineCurve * projectSolution (const IntegrandBase &integrand) const
 Projects the secondary solution field onto the primary basis. More...
 
virtual Go::GeomObject * evalSolution (const IntegrandBase &integrand) const
 Projects the secondary solution field onto the primary basis. More...
 
virtual FieldsgetProjectedFields (const Vector &coefs, size_t=0) const
 Returns a field using the projection basis. More...
 
virtual bool evalSolution (Matrix &sField, const IntegrandBase &integrand, const RealArray *gpar, bool=true) const
 Evaluates the secondary solution field at the given points. More...
 
virtual bool getGridParameters (RealArray &prm, int nSegSpan) const
 Calculates parameter values for visualization nodal points. More...
 
virtual void evaluateBasis (double u, double, double, Vector &N) const
 Evaluates the basis functions at the specified point. More...
 
void extractBasis (double u, Vector &N) const
 Establishes the vector with basis function values. More...
 
void extractBasis (double u, Vector &N, Matrix &dNdu) const
 Establishes matrices with basis functions and 1st derivatives. More...
 
void extractBasis (double u, Vector &N, Matrix &dNdu, Matrix3D &d2Ndu2) const
 Establishes matrices with basis functions, 1st and 2nd derivatives. More...
 
void extractBasis (double u, Vector &N, Matrix &dNdu, Matrix3D &d2Ndu2, Matrix4D &d3Ndu3) const
 Establishes matrices with basis functions, 1st, 2nd and 3rd derivatives. More...
 
virtual bool getOrder (int &p1, int &p2, int &p3) const
 Returns the polynomial order 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 bool getNoStructElms (int &n1, int &n2, int &n3) const
 Returns the number of elements in each parameter direction. More...
 
virtual size_t getNoNodes (int basis=0) const
 Returns the total number of nodes in this patch.
 
virtual size_t getNoProjectionNodes () const
 Returns the number of projection nodes for this patch.
 
virtual bool getParameterDomain (Real2DMat &u, IntVec *corners) const
 Returns parameter values and node numbers of the domain corners. More...
 
virtual void getElmConnectivities (IntMat &neigh, int basis=ASM::INTEGRATION_BASIS) const
 Calculates the matrix of element neighbour connectivities. More...
 
virtual IntMat getElmNodes (int basis) const
 Returns the matrix of nodal point correspondance for given basis.
 
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...
 
- Public Member Functions inherited from ASMstruct
virtual ~ASMstruct ()
 The destructor frees the dynamically allocated spline objects.
 
virtual bool empty () const
 Checks if the patch is empty.
 
virtual bool diracPoint (Integrand &integr, GlobalIntegral &glInt, const double *u, const Vec3 &pval)
 Integrates a spatial dirac-delta function over a patch. More...
 
virtual bool separateProjectionBasis () const
 Checks if a separate projection basis is used for this patch.
 
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.
 
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 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 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 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.
 
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.
 
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 void copyParameterDomain (const ASMbase *)
 Copies the parameter domain from another patch.
 
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 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 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 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 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 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 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 FieldgetProjectedField (const Vector &) const
 Returns a field using the 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...
 
- Public Member Functions inherited from ASMunstruct
virtual ~ASMunstruct ()
 Empty destructor.
 
virtual void remapErrors (RealArray &errors, const RealArray &orig, bool=false) const
 Remaps element-wise errors from geometry mesh to refinement mesh. More...
 
virtual IntVec getBoundaryCovered (const IntSet &) const
 Returns all boundary functions that are covered by the given nodes.
 
virtual void extendRefinementDomain (IntSet &, const IntSet &) const
 Extends the refinement domain with information for neighbors.
 
virtual void storeMesh (const std::string &fName, int fType=15) const
 Stores the mesh basis to encapsulated postscript files. More...
 
- Public Member Functions inherited from ASM1D
virtual ~ASM1D ()
 Empty destructor.
 
ASMbaseclone (unsigned char *nf=nullptr) const
 Returns a copy of this patch with identical FE discretization. More...
 
virtual bool refine (const std::vector< double > &xi)=0
 Refines the parametrization by inserting extra knots. More...
 
virtual bool getGridParameters (std::vector< double > &prm, int nSegSpan) const =0
 Calculates parameter values for visualization nodal points. More...
 

Static Public Member Functions

static void scatterInd (int p1, 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 ASM1D
static ASMbasecreate (ASM::Discretization type, unsigned char nd, unsigned char nf)
 Creates a one-parametric patch of specified discretization type. More...
 
static ASMbasecreate (ASM::Discretization type, unsigned char nf=1)
 Creates a one-parametric patch of specified discretization type. More...
 
static double getElementSize (const std::vector< Vec3 > &XC)
 Returns characteristic element size based on end point coordinates.
 

Protected Member Functions

virtual void findBoundaryElms (IntVec &elms, int lIndex, int=0) const
 Finds the path-local element numbers on a patch boundary. More...
 
virtual bool assembleL2matrices (SystemMatrix &A, SystemVector &B, const L2Integrand &integrand, bool continuous) const
 Assembles L2-projection matrices for the secondary solution. More...
 
virtual bool initLocalElementAxes (const Vec3 &Zaxis)
 Initializes the local element axes for a patch of beam elements. More...
 
bool connectBasis (ASMs1D &neighbor, int slave, int master, int thick=1)
 Connects matching nodes on two adjacent vertices. More...
 
bool getGrevilleParameters (RealArray &prm) const
 Calculates parameter values for the Greville points. More...
 
double getKnotSpan (int i) const
 Returns the parametric length on the i'th knot-span.
 
virtual void getElementBorders (int iel, double *u) const
 Computes the element border parameters. More...
 
double getElementEnds (int i, std::vector< Vec3 > &XC) const
 Computes the element end coordinates. More...
 
bool getElementNodalRotations (TensorVec &T, size_t iel) const
 Returns nodal rotation matrices for an element, if any. More...
 
Tensor getLocal2Global (double u) const
 Returns the local-to-global transformation at a parametric point.
 
- 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 ASMunstruct
 ASMunstruct ()
 The constructor is protected to allow objects of sub-classes only.
 
- Protected Member Functions inherited from ASM1D
 ASM1D ()
 The constructor is protected to allow objects of sub-classes only.
 

Protected Attributes

std::shared_ptr< Go::SplineCurve > curv
 The actual spline curve object.
 
std::shared_ptr< Go::SplineCurve > proj
 Spline curve for projection basis.
 
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()
 
IntMat projMNPC
 Matrix of Nodal Point Correspondance for projection.
 
IntVec projMLGE
 Matrix of Local to Global Element numbers for projection.
 
const TensorVecelmCS
 Element coordinate systems (for 3D beams)
 
const TensorVecnodalT
 Nodal rotation tensors (for 3D beams)
 
TensorVec myCS
 The actual element coordinate systems.
 
TensorVec myT
 The actual nodal rotation tensors.
 
TensorVec prevT
 Nodal rotation tensors of last converged configuration.
 
std::vector< ASM::NodeSetnodeSets
 Node sets for Dirichlet BCs.
 
- 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.
 

Private Member Functions

bool getElementCoordinates (Matrix &X, const IntVec &mnpc, const Go::SplineCurve *crv) const
 Returns a matrix with nodal coordinates for an element. More...
 

Static Private Member Functions

static void createMNPC (const Go::SplineCurve *crv, IntMat &MNPC)
 Creates matrix of nodal point correspondance for a spline curve.
 

Private Attributes

bool updatedT
 If true, nodal rotation matrices have been updated.
 

Additional Inherited Members

- Public Types inherited from ASMbase
using BCVec = std::vector< BC >
 Nodal boundary condition container.
 
- 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 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 structured 1D spline FE models.

This class contains methods common for structured 1D spline patches.

Member Function Documentation

◆ applyTwist()

void ASMs1D::applyTwist ( const RealFunc twist)

Applies a twist angle to the beam transformation matrices.

Parameters
[in]twistFunction describing the twist angle along the beam

References getCoord(), ASMbase::MLGE, ASMbase::MLGN, ASMbase::MNPC, and myCS.

◆ assembleL2matrices()

bool ASMs1D::assembleL2matrices ( SystemMatrix A,
SystemVector B,
const L2Integrand integrand,
bool  continuous 
) const
protectedvirtual

Assembles L2-projection matrices for the secondary solution.

Parameters
[out]ALeft-hand-side matrix
[out]BRight-hand-side vectors
[in]integrandObject with problem-specific data and methods
[in]continuousIf false, a discrete L2-projection is used

Reimplemented from ASMbase.

References SystemMatrix::assemble(), SystemVector::assemble(), L2Integrand::evaluate(), utl::matrix< T >::fillColumn(), GaussQuadrature::getCoord(), getElementCoordinates(), SplineUtils::getGaussParameters(), ASMbase::getNoGaussPt(), getNoProjectionNodes(), GaussQuadrature::getWeight(), ASMbase::idx, utl::Jacobian(), ASMbase::MLGE, ASMbase::MNPC, ASMbase::nnod, utl::matrix< T >::outer_product(), proj, projMLGE, projMNPC, utl::matrix< T >::resize(), utl::matrix< T >::rows(), and utl::vector< T >::size().

◆ clear()

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

Clears the contents of the 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 from ASMbase.

Reimplemented in ASMs1DLag.

References ASMbase::clear(), curv, ASMstruct::geomB, proj, and ASMstruct::projB.

Referenced by ASMs1DLag::clear().

◆ closeBoundaries()

void ASMs1D::closeBoundaries ( int  ,
int  basis,
int  master 
)
virtual

Makes the two end vertices of the curve periodic.

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

Reimplemented from ASMbase.

References getSize(), and ASMbase::makePeriodic().

◆ connectBasis()

bool ASMs1D::connectBasis ( ASMs1D neighbor,
int  slave,
int  master,
int  thick = 1 
)
protected

Connects matching nodes on two adjacent vertices.

Parameters
neighborThe neighbor patch
[in]slave1-based index of the first slave node in this basis
[in]master1-based index of the first master node in this basis
[in]thickThickness of connection

References ASMbase::collapseNodes(), Vec3::equal(), getCoord(), and ASMbase::shareFE.

Referenced by connectPatch().

◆ connectPatch()

bool ASMs1D::connectPatch ( int  vertex,
ASM1D neighbor,
int  nvertex,
int  thick = 1 
)
virtual

Connects matching nodes on two adjacent vertices.

Parameters
[in]vertexLocal vertex index of this patch, in range [1,2]
neighborThe neighbor patch
[in]nvertexLocal vertex index of neighbor patch, in range [1,2]
[in]thickThickness of connection

Implements ASM1D.

References ASMbase::addNeighbor(), connectBasis(), and getSize().

◆ constrainEndLocal()

size_t ASMs1D::constrainEndLocal ( int  dir,
int  dof,
int  code 
)
virtual

Constrains all DOFs in local directions at a given end point.

Parameters
[in]dirParameter direction defining the end to constrain
[in]dofWhich local DOFs to constrain at the end point
[in]codeInhomogeneous dirichlet condition code

Implements ASM1D.

Reimplemented in ASMs1DC1.

References ASMbase::addLocal2GlobalCpl(), ASMbase::allDofs(), constrainNode(), curv, getLocal2Global(), getSize(), ASMbase::gNod, ASMbase::MLGN, ASMbase::myMLGN, nxMap, ASMbase::prescribe(), ASMbase::shareFE, xnMap, and ASMbase::xNode.

Referenced by ASMs1DC1::constrainEndLocal().

◆ constrainNode()

int ASMs1D::constrainNode ( double  xi,
int  dof,
int  code 
)
virtual

Constrains a node identified by a relative parameter value.

Parameters
[in]xiParameter value along the curve
[in]dofWhich DOFs to constrain at the node
[in]codeInhomogeneous dirichlet condition code
Returns
1-based index of the constrained node

The parameter value has to be in the domain [0.0,1.0], where 0.0 means the beginning of the domain and 1.0 means the end. For values in between, the actual index is taken as the integer value closest to r*n, where r denotes the given relative parameter value, and n is the number of nodes along that parameter direction.

Implements ASM1D.

Reimplemented in ASMs1DC1.

References getSize(), and ASMbase::prescribe().

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

◆ createProjectionBasis()

bool ASMs1D::createProjectionBasis ( bool  init)
virtual

Creates a separate projection basis for this patch.

This method is supposed to be invoked twice during the model generation. In the first call, with init = true, the spline curve object curv is cloned into proj and the two pointers are then swapped, such that the subsequent refine() and raiseOrder() operations will apply to the projection basis and not on the geometry basis. In the second call, the pointers are swapped back.

The method can also be invoked twice with init = false in case the projection basis is to be read from a file.

Reimplemented from ASMbase.

References curv, proj, and ASMstruct::projB.

◆ evalPoint()

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

Evaluates the geometry at a specified point.

Parameters
[in]xiDimensionless parameter in range [0.0,1.0] of the point
[out]paramThe parameter of the point in knot-span domain
[out]XThe Cartesian coordinates of the point
Returns
Local node number within the patch that matches the point, if any
0 if no node (control point) matches this point

Implements ASMbase.

Reimplemented in ASMs1DLag.

References curv, SplineUtils::point(), and ASMbase::searchCtrlPt().

◆ evalProjSolution()

bool ASMs1D::evalProjSolution ( Matrix sField,
const Vector locSol,
const int *  npe,
int   
) const
virtual

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

Reimplemented from ASMbase.

References ASMstruct::evalSolution(), utl::matrix< T >::fillColumn(), getGridParameters(), Fields::getNoFields(), getProjectedFields(), utl::matrix< T >::resize(), ASMstruct::separateProjectionBasis(), and Fields::valueFE().

◆ evalSolution() [1/5]

Go::GeomObject * ASMs1D::evalSolution ( const IntegrandBase integrand) const
virtual

Projects the secondary solution field onto the primary basis.

Parameters
[in]integrandObject with problem-specific data and methods

Implements ASMstruct.

References projectSolution().

◆ evalSolution() [2/5]

bool ASMs1D::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 the projection 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 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 from ASMbase.

Reimplemented in ASMs1DLag.

References ASMstruct::evalSolution(), utl::matrix< T >::fill(), getGridParameters(), SplineUtils::project(), projectSolution(), and utl::matrix< T >::resize().

◆ evalSolution() [3/5]

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

◆ evalSolution() [4/5]

bool ASMs1D::evalSolution ( Matrix sField,
const Vector locSol,
const int *  npe,
int  ,
bool   
) const
virtual

Evaluates the primary solution field at all visualization points.

Parameters
[out]sFieldSolution field
[in]locSolSolution vector in DOF-order
[in]npeNumber of visualization nodes over each knot span

Reimplemented from ASMbase.

Reimplemented in ASMs1DLag.

References ASMstruct::evalSolution(), and getGridParameters().

◆ evalSolution() [5/5]

bool ASMs1D::evalSolution ( Matrix sField,
const Vector locSol,
const RealArray gpar,
bool  = true,
int  deriv = 0,
int  = 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]derivDerivative order to return

Reimplemented from ASMbase.

Reimplemented in ASMs1DLag.

References curv, extractBasis(), utl::matrix< T >::fillColumn(), utl::gather(), getNodalCoordinates(), utl::Hessian(), utl::Jacobian(), utl::matrix< T >::multiply(), utl::matrix3d< T >::multiply(), ASMbase::nsd, utl::matrix< T >::resize(), scatterInd(), and utl::vector< T >::size().

◆ evaluate() [1/4]

bool ASMbase::evaluate

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)

◆ evaluate() [2/4]

bool ASMbase::evaluate

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)

References IFEM::cout.

◆ evaluate() [3/4]

bool ASMbase::evaluate

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

◆ evaluate() [4/4]

bool ASMs1D::evaluate ( const FunctionBase func,
RealArray vec,
int  ,
double  time 
) const
virtual

Evaluates and interpolates a function over a given geometry.

Parameters
[in]funcThe function to evaluate
[out]vecThe obtained coefficients after interpolation
[in]timeCurrent time

Reimplemented from ASMbase.

References curv, FunctionBase::dim(), and SplineUtils::project().

◆ evaluateBasis()

void ASMs1D::evaluateBasis ( double  u,
double  ,
double  ,
Vector N 
) const
virtual

Evaluates the basis functions at the specified point.

Parameters
[in]uParameter value of evaluation point
[out]NBasis function values

Implements ASMstruct.

References extractBasis().

◆ extractBasis() [1/4]

void ASMs1D::extractBasis ( double  u,
Vector N 
) const

Establishes the vector with basis function values.

Parameters
[in]uParameter value of current integration point
[out]NBasis function values

References curv, and utl::vector< T >::resize().

Referenced by evalSolution(), evaluateBasis(), and integrate().

◆ extractBasis() [2/4]

void ASMs1D::extractBasis ( double  u,
Vector N,
Matrix dNdu 
) const

Establishes matrices with basis functions and 1st derivatives.

Parameters
[in]uParameter value of current integration point
[out]NBasis function values
[out]dNduFirst derivatives of basis functions

References curv, utl::matrix< T >::fillColumn(), utl::vector< T >::resize(), and utl::matrix< T >::resize().

◆ extractBasis() [3/4]

void ASMs1D::extractBasis ( double  u,
Vector N,
Matrix dNdu,
Matrix3D d2Ndu2 
) const

Establishes matrices with basis functions, 1st and 2nd derivatives.

Parameters
[in]uParameter value of current integration point
[out]NBasis function values
[out]dNduFirst derivatives of basis functions
[out]d2Ndu2Second derivatives of basis functions

References curv, utl::matrix< T >::fillColumn(), utl::matrix3d< T >::fillColumn(), utl::vector< T >::resize(), utl::matrix3d< T >::resize(), and utl::matrix< T >::resize().

◆ extractBasis() [4/4]

void ASMs1D::extractBasis ( double  u,
Vector N,
Matrix dNdu,
Matrix3D d2Ndu2,
Matrix4D d3Ndu3 
) const

Establishes matrices with basis functions, 1st, 2nd and 3rd derivatives.

Parameters
[in]uParameter value of current integration point
[out]NBasis function values
[out]dNduFirst derivatives of basis functions
[out]d2Ndu2Second derivatives of basis functions
[out]d3Ndu3Third derivatives of basis functions

References curv, utl::matrix< T >::fillColumn(), utl::matrix3d< T >::fillColumn(), utl::matrix4d< T >::fillColumn(), utl::vector< T >::resize(), utl::matrix3d< T >::resize(), utl::matrix4d< T >::resize(), and utl::matrix< T >::resize().

◆ findBoundaryElms()

void ASMs1D::findBoundaryElms ( IntVec elms,
int  lIndex,
int  = 0 
) const
protectedvirtual

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

Parameters
[out]elmsArray of element numbers
[in]lIndexLocal index of the end point

Implements ASMbase.

References ASMbase::nel.

◆ findClosestNode()

std::pair< size_t, double > ASMs1D::findClosestNode ( const Vec3 X) const
virtual

Finds the node that is closest to the given point.

Parameters
[in]XGlobal coordinates of point to search for
Returns
1-based nodal index and distance to to the found node

Reimplemented from ASMbase.

References curv, and findPoint().

◆ findElement()

std::pair< int, double > ASMs1D::findElement ( const Vec3 X) const

Finds the element that contains the given point.

Parameters
[in]XGlobal coordinates of point to search for
Returns
1-based element index and local parameter in [-1,1] of the point

If the point is outside the domain, either the first or the last element is returned, and the local parameter is then either less than -1.0 or greater than 1.0 such that extrapolation can be performed.

References curv, ASMbase::nel, SplineUtils::point(), Vec3::x, Vec3::y, and Vec3::z.

◆ findElementContaining()

int ASMs1D::findElementContaining ( const double *  param) const
virtual

Returns the element that contains a specified spatial point.

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

Implements ASMbase.

References curv.

Referenced by evalSolution().

◆ findPoint()

double ASMs1D::findPoint ( Vec3 X,
double *  param 
) const
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

Implements ASMbase.

References curv, Vec3::x, Vec3::y, and Vec3::z.

Referenced by findClosestNode().

◆ generateFEMTopology()

bool ASMs1D::generateFEMTopology ( )
virtual

Generates the finite element topology data for the patch.

The data generated are the element-to-node connectivity array, and the global node and element numbers.

Implements ASMbase.

Reimplemented in ASMs1DC1.

Referenced by ASMs1DC1::generateFEMTopology().

◆ generateOrientedFEModel()

bool ASMs1D::generateOrientedFEModel ( const Vec3 Zaxis)
virtual

Generates a beam finite element model for the patch.

Parameters
[in]ZaxisVector defining a point in the local XZ-plane

This method will, in addition to the FE topology generation, set up the local-to-global transformation tensor for each element in the patch, if we are solving a 3D beam problem ( nsd = 3 and nf = 6 ). These transformations are kept constant during the simulation. In addition, nodal tensors for the updated rotation state are allocated.

Reimplemented in ASMu1DLag, and ASMs1DLag.

References curv, and proj.

Referenced by ASMs1DLag::evalSolution().

◆ getBoundaryNodes()

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

Finds the global (or patch-local) node number on a patch end.

Parameters
[in]lIndexLocal index of the end point
nodesArray of global boundary node numbers
[in]thickThickness of connection
[in]localIf true, return patch-local node numbers

Implements ASMbase.

Reimplemented in ASMu1DLag.

References curv, ASMbase::MLGE, ASMbase::MLGN, ASMbase::MNPC, and ASMbase::nel.

◆ getCoord()

Vec3 ASMs1D::getCoord ( size_t  inod) const
virtual

Returns the global coordinates for the given node.

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

Implements ASMbase.

Reimplemented in ASMs1DLag.

References curv, ASMbase::myRmaster, and ASMbase::nsd.

Referenced by ASMs1DC1::addRigidCpl(), applyTwist(), connectBasis(), and initLocalElementAxes().

◆ getElementBorders()

void ASMs1D::getElementBorders ( int  iel,
double *  u 
) const
protectedvirtual

Computes the element border parameters.

Parameters
[in]iel1-based element index local to current patch
[out]uParameter values of the element borders

Implements ASMstruct.

References curv.

Referenced by getElementCenter().

◆ getElementCoordinates() [1/2]

bool ASMs1D::getElementCoordinates ( Matrix X,
const IntVec mnpc,
const Go::SplineCurve *  crv 
) const
private

Returns a matrix with nodal coordinates for an element.

Parameters
[out]X3 \(\times\)n-matrix, where n is the number of nodes
[in]mnpcMatrix of nodal point correspondence for the element
[in]crvUnderlying spline curve for current patch

References utl::matrix< T >::cols(), utl::matrix< T >::fillColumn(), ASMbase::nsd, and utl::matrix< T >::resize().

◆ getElementCoordinates() [2/2]

bool ASMs1D::getElementCoordinates ( Matrix X,
int  iel,
bool  = false 
) const
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

Implements ASMbase.

Reimplemented in ASMs1DLag.

References curv, and ASMbase::MNPC.

Referenced by assembleL2matrices(), and integrate().

◆ getElementEnds()

double ASMs1D::getElementEnds ( int  i,
std::vector< Vec3 > &  XC 
) const
protected

Computes the element end coordinates.

Parameters
[in]iParameter index for the knot-span element
[out]XCCoordinates of the element corners
Returns
Element length

References curv, elmCS, ASM1D::getElementSize(), and ASMbase::nsd.

Referenced by integrate().

◆ getElementNodalRotations()

bool ASMs1D::getElementNodalRotations ( TensorVec T,
size_t  iel 
) const
protected

Returns nodal rotation matrices for an element, if any.

Parameters
[out]TArray of nodal rotation matrices
[in]iel0-based element index local to current patch

This method extracts the updated rotation matrices for the element nodes, transformed to the local axes of the element.

References elmCS, ASMbase::MNPC, and nodalT.

Referenced by integrate(), and ASMs1DLag::integrate().

◆ getElmConnectivities()

void ASMs1D::getElmConnectivities ( IntMat neigh,
int  basis = ASM::INTEGRATION_BASIS 
) const
virtual

Calculates the matrix of element neighbour connectivities.

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

Implements ASMbase.

References ASMbase::idx, ASM::INTEGRATION_BASIS, ASMbase::MLGE, and ASMbase::nel.

◆ getGrevilleParameters()

bool ASMs1D::getGrevilleParameters ( RealArray prm) const
protected

Calculates parameter values for the Greville points.

Parameters
[out]prmParameter values for all points

References curv.

Referenced by projectSolution().

◆ getGridParameters()

bool ASMs1D::getGridParameters ( RealArray prm,
int  nSegSpan 
) const
virtual

Calculates parameter values for visualization nodal points.

Parameters
[out]prmParameter values for all points
[in]nSegSpanNumber of visualization segments over each knot-span

Reimplemented in ASMs1DSpec.

References curv.

Referenced by ASMs1DLag::evalPoint(), evalProjSolution(), evalSolution(), ASMs1DLag::generateOrientedFEModel(), ASMs1DLag::integrate(), and tesselate().

◆ getNodalCoordinates()

void ASMs1D::getNodalCoordinates ( Matrix X,
bool  = false 
) const
virtual

Returns a matrix with all nodal coordinates within the patch.

Parameters
[out]X3 \(\times\)n-matrix, where n is the number of nodes in the patch

Implements ASMbase.

Reimplemented in ASMs1DLag.

References utl::matrix< T >::cols(), curv, utl::matrix< T >::fillColumn(), ASMbase::nsd, and utl::matrix< T >::resize().

Referenced by evalSolution().

◆ getNoStructElms()

bool ASMs1D::getNoStructElms ( int &  n1,
int &  n2,
int &  n3 
) const
virtual

Returns the number of elements in each parameter direction.

Parameters
[out]n1Number of elements in first (u) direction
[out]n2Number of elements in second (v) direction (always zero)
[out]n3Number of elements in third (w) direction (always zero)

Implements ASMstruct.

References ASMbase::nel.

◆ getOrder()

bool ASMs1D::getOrder ( int &  p1,
int &  p2,
int &  p3 
) const
virtual

Returns the polynomial order in each parameter direction.

Parameters
[out]p1Order in first (u) direction
[out]p2Order in second (v) direction (always zero)
[out]p3Order in third (w) direction (always zero)

Reimplemented from ASMbase.

References curv.

◆ getParameterDomain()

bool ASMs1D::getParameterDomain ( Real2DMat u,
IntVec corners 
) const
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)

Implements ASMbase.

References curv.

◆ getProjectedFields()

Fields * ASMs1D::getProjectedFields ( const Vector coefs,
size_t  = 0 
) const
virtual

Returns a field using the projection basis.

Parameters
[in]coefsThe coefficients for the field

Reimplemented from ASMbase.

References curv, getNoProjectionNodes(), proj, and utl::vector< T >::size().

Referenced by evalProjSolution().

◆ getRotation()

const Tensor & ASMs1D::getRotation ( size_t  inod) const

Returns the current rotation tensor for the given node.

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

References nodalT, and ASMbase::nsd.

◆ getSize()

bool ASMs1D::getSize ( int &  n1,
int &  n2,
int &  n3,
int  basis 
) const
virtual

Returns the number of nodal points in each parameter direction.

Parameters
[out]n1Number of nodes in first (u) direction
[out]n2Number of nodes in second (v) direction (always zero)
[out]n3Number of nodes in third (w) direction (always zero)
[in]basisWhich basis to return size parameters for (mixed methods)

Implements ASMstruct.

References getSize().

◆ getSolution()

bool ASMs1D::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 from ASMbase.

References ASMbase::getSolution(), ASMbase::nf, nodalT, updatedT, Vec3::x, Vec3::y, and Vec3::z.

◆ initLocalElementAxes()

bool ASMs1D::initLocalElementAxes ( const Vec3 Zaxis)
protectedvirtual

Initializes the local element axes for a patch of beam elements.

Parameters
[in]ZaxisVector defining a point in the local XZ-plane

This method calculates the local-to-global transformation for each 3D beam element in the patch, assuming the local X-axis passes through the two end nodes of the element and the local Y-axis is defined by the cross product between the given vector Zaxis and the local X-axis. If no Zaxis is given, the projection of either the global Y-axis or the global Z-axis onto the local X-axis is used as the local Y- or Z-axis, respectively, depending on which of these two global axes are closest to the local X-axis.

References getCoord(), Vec3::isZero(), ASMbase::MLGE, ASMbase::MNPC, and myCS.

Referenced by ASMs1DLag::generateOrientedFEModel(), and ASMu1DLag::generateOrientedFEModel().

◆ integrate() [1/2]

bool ASMs1D::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

Implements ASMbase.

Reimplemented in ASMs1DSpec, and ASMs1DLag.

References FiniteElement::age, GlobalIntegral::assemble(), Vec4::assign(), utl::matrix< T >::cols(), curv, FiniteElement::d2NdX2, FiniteElement::d3NdX3, ASMbase::dbgElm, LocalIntegral::destruct(), FiniteElement::detJxW, Tensor::diag(), FiniteElement::dNdX, Integrand::ELEMENT_CENTER, Integrand::ELEMENT_CORNERS, elmCS, utl::matrixBase< T >::empty(), Integrand::evalInt(), extractBasis(), utl::matrix< T >::fillColumn(), Integrand::finalizeElement(), ASMbase::firstEl, ASMbase::firstIp, FiniteElement::G, GaussQuadrature::getCoord(), getElementCoordinates(), getElementEnds(), getElementNodalRotations(), SplineUtils::getGaussParameters(), Integrand::getIntegrandType(), getKnotSpan(), Integrand::getLocalIntegral(), ASMbase::getNoGaussPt(), Integrand::getReducedIntegration(), GaussQuadrature::getWeight(), FiniteElement::h, utl::Hessian(), utl::Hessian2(), ItgPoint::idx, ItgPoint::iel, ItgPoint::iGP, Integrand::initElement(), utl::Jacobian(), ASMbase::MLGE, ASMbase::MNPC, utl::matrix< T >::multiply(), utl::matrix3d< T >::multiply(), utl::matrix4d< T >::multiply(), FiniteElement::N, ASMbase::nel, Integrand::NO_DERIVATIVES, Integrand::NODAL_ROTATIONS, ASMbase::nsd, SplineUtils::point(), utl::matrixBase< T >::ptr(), Integrand::reducedInt(), LocalIntegral::ref(), utl::matrix< T >::resize(), Integrand::SECOND_DERIVATIVES, utl::vector< T >::size(), TimeDomain::t, FiniteElement::Te, Integrand::THIRD_DERIVATIVES, FiniteElement::Tn, ItgPoint::u, FiniteElement::XC, ItgPoint::xi, and FiniteElement::Xn.

◆ integrate() [2/2]

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

◆ isInNodeSet()

bool ASMs1D::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(), ASMbase::getNodeIndex(), and nodeSets.

◆ projectSolution()

Go::SplineCurve * ASMs1D::projectSolution ( const IntegrandBase integrand) const

Projects the secondary solution field onto the primary basis.

Parameters
[in]integrandObject with problem-specific data and methods

References curv, ASMstruct::evalSolution(), getGrevilleParameters(), and utl::matrix< T >::rows().

Referenced by evalSolution().

◆ raiseOrder()

bool ASMs1D::raiseOrder ( int  ru)
virtual

Raises the order of the SplineCurve object for this patch.

Parameters
[in]ruNumber of times to raise the order

Implements ASM1D.

References curv, and ASMbase::shareFE.

◆ refine() [1/2]

bool ASMs1D::refine ( const LR::RefineData prm,
Vectors  
)
virtual

Refines the mesh adaptively.

Parameters
[in]prmInput data used to control the mesh refinement

Implements ASMunstruct.

References IFEM::cout, curv, LR::RefineData::elements, ASMbase::MLGE, ASMbase::nel, ASMbase::nnod, proj, LR::RefineData::refShare, and ASMbase::shareFE.

◆ refine() [2/2]

bool ASMs1D::refine ( const RealArray xi)
virtual

Refines the parametrization by inserting extra knots.

Parameters
[in]xiRelative positions of added knots in each existing knot span

References curv, and ASMbase::shareFE.

◆ tesselate()

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

Creates a line element model of this patch for visualization.

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

Implements ASMbase.

Reimplemented in ASMu1DLag, and ASMs1DLag.

References curv, getGridParameters(), ElementBlock::getNoNodes(), ASMbase::nsd, ElementBlock::resize(), ElementBlock::setCoor(), ElementBlock::setElmId(), and ElementBlock::setNode().

◆ uniformRefine()

bool ASMs1D::uniformRefine ( int  nInsert)
virtual

Refines the parametrization by inserting extra knots uniformly.

Parameters
[in]nInsertNumber of extra knots to insert in each knot-span

Implements ASM1D.

References curv, and ASMbase::shareFE.

◆ updateCoords()

bool ASMs1D::updateCoords ( const Vector displ)
virtual

Updates the nodal coordinates for this patch.

Parameters
[in]displIncremental displacements to update the coordinates with

Implements ASMbase.

Reimplemented in ASMs1DLag.

References curv, ASMbase::MLGN, ASMbase::nsd, ASMbase::shareFE, and utl::vector< T >::size().

◆ updateRotations()

bool ASMs1D::updateRotations ( const Vector displ,
bool  reInit = false 
)

Updates the nodal rotations for this patch.

Parameters
[in]displIncremental displacements to update the rotations with
[in]reInitIf true, reinitialize rotations from unity

References myT, ASMbase::nf, prevT, ASMbase::shareFE, utl::vector< T >::size(), and updatedT.


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