27using Ipair = std::pair<int,int>;
29using MPCMap = std::map<MPC*,int,MPCLess>;
30using MPCSet = std::set<MPC*,MPCLess>;
53 class InterfaceChecker;
54 using NodeSet = std::pair<std::string,IntVec>;
101 ASMbase(
unsigned char n_p,
unsigned char n_s,
unsigned char n_f);
132 virtual bool read(std::istream& is) = 0;
134 virtual bool readBasis(std::istream&,
size_t) {
return false; }
136 virtual bool write(std::ostream& os,
int basis = 0)
const = 0;
139 virtual void addHole(
double,
double,
double) {}
141 virtual void addHole(
double,
double,
double,
double,
double) {}
151 virtual void clear(
bool retainGeometry =
false);
158 virtual bool addXElms(
short int dim,
short int item,
size_t nXn,
166 unsigned char nnLag = 1);
172 unsigned char nnLag = 1);
207 virtual unsigned char getNoFields(
int b = 0)
const {
return b > 1 ? 0 :
nf; }
212 virtual bool getOrder(
int&,
int&,
int&)
const {
return false; }
217 virtual size_t getNodeIndex(
int globalNum,
bool =
false)
const;
220 virtual int getNodeID(
size_t inod,
bool =
false)
const;
256 bool forceItg =
false)
const = 0;
268 int basis = 0,
int thick = 1,
269 int orient = -1,
bool local =
false)
const = 0;
279 int basis = 0,
int orient = -1,
280 bool local =
false,
bool open =
false)
const {}
288 int orient = -1,
bool local =
false)
const;
300 int parseNodeSet(
const std::string& setName,
const char* cset,
301 bool assumeZeroBased =
false);
303 virtual int parseNodeBox(
const std::string&,
const char*) {
return 0; }
316 virtual int parseElemSet(
const std::string&,
const char*) {
return 0; }
319 const char*) {
return 0; }
323 {
return { 0, -1 }; }
351 bool inActive(
double time = -1.0)
const;
353 double getAge(
int iel,
double time)
const;
364 virtual size_t getNoNodes(
int basis = 0)
const;
370 size_t getNoElms(
bool includeZeroVolElms =
false,
371 bool includeXElms =
false)
const;
412 IntVec* corners =
nullptr)
const = 0;
440 bool mergeNodes(
size_t inod,
int globalNum,
bool verbose =
true);
453 std::map<int,int>& old2new);
470 const std::vector<int>& new2old = {},
int renumGN = 0,
471 std::map<int,int>* degenElm =
nullptr);
490 bool setPtrOnly =
false);
503 const std::map<int,VecFunc*>& vfunc);
512 const std::map<int,VecFunc*>& vfunc,
514 const std::map<int,int>* g2l =
nullptr,
515 bool tangent =
false);
585 const double* u,
const Vec3& p) {
return false; }
624 const IntVec& nodes)
const;
633 const int* npe,
int n_f = 0,
634 bool piola =
false)
const;
647 const int* npe,
int n_f = 0)
const
648 {
return this->
evalSolution(sField, locSol, npe, n_f); }
664 const RealArray* gpar,
bool regular =
true,
665 int deriv = 0,
int n_f = 0)
const;
679 const RealArray* gpar,
bool regular)
const;
701 int basisNum = 1,
double time = 0.0)
const;
717 const int* npe =
nullptr,
char project = 0)
const;
733 const RealArray* gpar,
bool regular =
true)
const;
745 const IntVec& elements)
const;
754 bool continuous =
false,
755 bool enforceEnds =
false)
const;
785 const std::vector<FunctionBase*>& funcs,
double t = 0.0);
825 size_t internalFirst = 0)
const;
838 const int* madof,
int ngnod = -1)
const;
846 unsigned char nndof = 0,
int basis = 0)
const;
854 unsigned char nndof = 0,
int basis = 0)
const;
862 const IntVec& madof,
int basis = 0)
const;
869 bool add2PC(
int slave,
int dir,
int master,
int code = 0);
877 bool verbose =
false,
bool overrideD =
false);
887 virtual bool addRigidCpl(
int lindx,
int ldim,
int basis,
888 int& gMaster,
const Vec3& Xmaster,
889 bool extraPt =
true);
896 const IntVec& slaveNodes);
921 bool add3PC(
int slave,
int dir,
int master1,
int master2,
int code = 0);
931 void makePeriodic(
size_t master,
size_t slave,
int dirs = 123);
961 int searchCtrlPt(RealArray::const_iterator cit, RealArray::const_iterator end,
962 const Vec3& X,
int dimension,
double xtol = 0.001)
const;
977 bool continuous)
const {
return false; }
994 bool overrideD =
false);
1008 int prescribe(
size_t inod,
int dirs,
int code,
bool overrideD =
false);
1013 int fix(
size_t inod,
int dirs = 123);
1018 bool isFixed(
int node,
int dof,
bool all =
false)
const;
1023 double xtol = 1.0e-8);
1034 bool force2nd =
false);
1042 bool writeLagBasis(std::ostream& os,
const char* type)
const;
1116 using XYZ = std::array<double,3>;
MPCSet::const_iterator MPCIter
Iterator over an MPC-equation set.
Definition ASMbase.h:31
std::set< MPC *, MPCLess > MPCSet
Sorted set of MPC-equations.
Definition ASMbase.h:30
std::pair< int, int > Ipair
A pair of integers.
Definition ASMbase.h:27
std::vector< int > IntVec
General integer vector.
Definition ASMbase.h:25
std::map< MPC *, int, MPCLess > MPCMap
MPC-to-function code mapping.
Definition ASMbase.h:29
std::vector< IntVec > IntMat
General 2D integer matrix.
Definition ASMbase.h:26
std::vector< RealArray > Real2DMat
A real-valued two-dimensional array without algebraic operations.
Definition ImmersedBoundaries.h:34
std::vector< Real > RealArray
A real-valued array without algebraic operations.
Definition ImmersedBoundaries.h:32
Comparison of two MPC objects in a std::set<MPC*,MPCLess> object.
Global algebraic operations on index 1-based matrices and vectors.
std::vector< Vector > Vectors
An array of real-valued vectors with algebraic operations.
Definition MatVec.h:37
Base class to check for internal boundary integrand contributions.
Definition Interface.h:40
Base class for spline-based finite element (FE) assembly drivers.
Definition ASMbase.h:72
virtual int getElementSetIdx(const std::string &) const
Returns (1-based) index of a predefined element set in the patch.
Definition ASMbase.h:308
size_t nel
Number of regular elements in this patch.
Definition ASMbase.h:1059
bool globalL2projection(Matrix &sField, const L2Integrand &integrand, bool continuous=false, bool enforceEnds=false) const
Projects the secondary solution using a (discrete) global L2-fit.
Definition GlbL2projector.C:589
MPCIter begin_MPC() const
Returns the beginning of the mpcs set.
Definition ASMbase.h:395
virtual int getNodeID(size_t inod, bool=false) const
Returns the global node number for the given node.
Definition ASMbase.C:277
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.
Definition ASMbase.C:1648
virtual Field * getProjectedField(const Vector &) const
Returns a field using the projection basis.
Definition ASMbase.h:797
virtual bool setGeometry(RealFunc *, double, double)
Defines the immersed geometry from a scalar function.
Definition ASMbase.h:143
virtual bool integrate(Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)=0
Evaluates an integral over the interior patch domain.
bool writeLagBasis(std::ostream &os, const char *type) const
Writes a Lagrangian basis to the given stream.
Definition ASMbase.C:1859
virtual bool evalSolutionPiola(Matrix &sField, const Vector &locSol, const RealArray *gpar, bool regular) const
Evaluates the primary solution field with Piola mapping.
Definition ASMbase.C:1810
size_t getNoElms(bool includeZeroVolElms=false, bool includeXElms=false) const
Returns the total number of elements in this patch.
Definition ASMbase.C:340
unsigned char nLag
Number of Lagrange multipliers per node.
Definition ASMbase.h:1058
virtual std::pair< size_t, double > findClosestNode(const Vec3 &) const
Finds the node that is closest to the given point.
Definition ASMbase.h:322
virtual int findElementContaining(const double *param) const =0
Returns the element that contains a specified spatial point.
const IntMat & MNPC
Matrix of Nodal Point Correspondance.
Definition ASMbase.h:1064
IntVec * myActiveEls
List of active elements during element assembly.
Definition ASMbase.h:1111
const IntVec & MLGN
Matrix of Local to Global Node numbers.
Definition ASMbase.h:1063
int getElmID(size_t iel) const
Returns the global element number for the given element.
Definition ASMbase.C:296
static void mergeAndGetAllMPCs(const ASM::PatchVec &model, MPCSet &allMPCs)
Computes the set of all MPC-equations over the whole model.
Definition ASMbase.C:984
virtual bool addXElms(short int dim, short int item, size_t nXn, IntVec &nodes)
Adds extraordinary elements associated with a patch boundary.
Definition ASMbase.C:195
virtual bool assembleL2matrices(SystemMatrix &A, SystemVector &B, const L2Integrand &obj, bool continuous) const
Assembles L2-projection matrices for the secondary solution.
Definition ASMbase.h:975
static int dbgElm
One-based element index to print debugging info for.
Definition ASMbase.h:1047
static std::map< int, int > xNode
Auxilliary node number map used when establishing Dirichlet constraints.
Definition ASMbase.h:1101
virtual void closeBoundaries(int dir=1, int basis=0, int master=1)
Makes two opposite boundaries periodic.
Definition ASMbase.h:434
std::vector< ASM::NodeSet > nodeSets
Node sets for explicit Dirichlet BCs.
Definition ASMbase.h:1075
virtual double findPoint(Vec3 &X, double *param) const =0
Searches for the specified Cartesian point in the patch.
virtual void changeNumThreads()
Hook for changing number of threads.
Definition ASMbase.h:539
bool active
If true, the patch is currently active.
Definition ASMbase.h:1112
virtual int parseElemSet(const std::string &, const char *)
Defines an element set by parsing a list of element numbers.
Definition ASMbase.h:316
void addRigidMPC(int gSlave, int gMaster, const Vec3 &dX)
Adds MPC-equations representing a rigid arm to a 6-DOF node.
Definition ASMbase.C:654
char getLMType(size_t inod) const
Returns the type of a Lagrange multiplier node.
Definition ASMbase.C:283
virtual bool separateProjectionBasis() const
Checks if a separate projection basis is used for this patch.
Definition ASMbase.h:807
virtual void getNodalCoordinates(Matrix &X, bool geo=false) const =0
Returns a matrix with all nodal coordinates within the patch.
MPCSet mpcs
All multi-point constraints with the slave in this patch.
Definition ASMbase.h:1073
void convertNodeSets()
Converts node number sets to internal (1-based) node indices.
Definition ASMbase.C:2020
IntVec myMLGN
The actual Matrix of Local to Global Node numbers.
Definition ASMbase.h:1078
virtual bool checkElementSize(int, bool=true) const
Checks if the specified element is larger than the minimum size.
Definition ASMbase.h:193
virtual void generateThreadGroupsFromElms(const IntVec &)
Generates element groups for multi-threading based on a partition.
Definition ASMbase.h:532
virtual bool evalProjSolution(Matrix &sField, const Vector &locSol, const int *npe, int n_f=0) const
Evaluates the projected solution field at all visualization points.
Definition ASMbase.h:646
virtual void addHole(double, double, double)
Adds a circular immersed boundary in the physical geometry.
Definition ASMbase.h:139
static IntVec Empty
Empty integer vector used when a reference is needed.
Definition ASMbase.h:1113
virtual bool initConstraints()
Initializes the multi-point constraint coefficients.
Definition ASMbase.h:493
static bool collapseNodes(ASMbase &pch1, int node1, ASMbase &pch2, int node2)
Collapses the given two nodes into one.
Definition ASMbase.C:1280
unsigned char nf
Number of primary solution fields (1 or larger)
Definition ASMbase.h:1057
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.
Definition ASMbase.h:278
void setNoFields(unsigned char n)
Defines the number of solution fields in the patch.
Definition ASMbase.h:181
virtual void getNoBouPoints(size_t &nPt, char ldim, char lindx)
Computes the number of boundary integration points in this patch.
Definition ASMbase.C:388
virtual size_t getNoProjectionNodes() const
Returns the number of projection nodes for this patch.
Definition ASMbase.h:788
virtual const IntVec & getElementSet(int) const
Returns an indexed predefined element set.
Definition ASMbase.h:310
virtual bool tesselate(ElementBlock &grid, const int *npe) const =0
Creates a standard FE model of this patch for visualization.
bool add2PC(int slave, int dir, int master, int code=0)
Creates and adds a two-point constraint to this patch.
Definition ASMbase.C:557
unsigned char getNoSpaceDim() const
Returns the number of spatial dimensions.
Definition ASMbase.h:203
const IntVec & getGlobalNodeNums() const
Returns the global node numbers of this patch.
Definition ASMbase.h:339
virtual bool getSolution(Matrix &sField, const Vector &locSol, const IntVec &nodes) const
Extract the primary solution field at the specified nodes.
Definition ASMbase.C:1682
bool constrainXnode(int node, int dof, int code=0)
Constrains an extraordinary node in the patch.
Definition ASMbase.C:846
virtual size_t getNodeIndex(int globalNum, bool=false) const
Returns local 1-based index of the node with given global number.
Definition ASMbase.C:271
virtual bool readBasis(std::istream &, size_t)
Reads a basis from the given input stream.
Definition ASMbase.h:134
virtual bool generateFEMTopology()=0
Generates the finite element topology data for this patch.
unsigned char getNoParamDim() const
Returns the number of parameter dimensions.
Definition ASMbase.h:205
void addLocal2GlobalCpl(int iSlave, int master, const Tensor &Tlg)
Creates constraint equations coupling global DOFs to local DOFs.
Definition ASMbase.C:596
int parseNodeSet(const std::string &setName, const char *cset, bool assumeZeroBased=false)
Defines a node set by parsing a list of node numbers.
Definition ASMbase.C:2001
void addNeighbor(ASMbase *pch)
Adds a patch to the list of neighbors of this patch.
Definition ASMbase.C:1270
const IntVec & getMyNodeNums() const
Returns the actual global node numbers of this patch.
Definition ASMbase.h:337
IntMat::const_iterator end_elm() const
Returns the end of the MNPC array.
Definition ASMbase.h:392
bool hasXNodes() const
Returns true if this patch has additional (extraordinary) nodes.
Definition ASMbase.h:406
bool isRMn(size_t n) const
Returns true if node n is a master node of a rigid coupling.
Definition ASMbase.h:237
void extractElmRes(const Vector &globRes, Vector &elmRes, size_t internalFirst=0) const
Extracts element results for this patch from a global vector.
Definition ASMbase.C:1481
virtual Fields * getProjectedFields(const Vector &, size_t) const
Returns a field using the projection basis.
Definition ASMbase.h:801
virtual bool diracPoint(Integrand &integrand, GlobalIntegral &glbInt, const double *u, const Vec3 &p)
Integrates a spatial dirac-delta function over a patch.
Definition ASMbase.h:584
bool allDofs(int dirs) const
Returns true if dirs constains all local DOFs in the patch.
Definition ASMbase.C:973
size_t nnod
Number of regular nodes in this patch.
Definition ASMbase.h:1060
bool createRgdMasterNode(int &gMaster, const Vec3 &Xmaster)
Creates an additional master node for a rigid coupling.
Definition ASMbase.C:636
bool hasTimeDependentDirichlet(const std::map< int, RealFunc * > &func, const std::map< int, VecFunc * > &vfunc)
Checks for time-dependent in-homogeneous Dirichlet conditions.
Definition ASMbase.C:1181
bool isInNodeSet(int iset, int inod) const
Checks if node inod is within predefined node set iset.
Definition ASMbase.C:1989
MPCMap dCode
Inhomogeneous Dirichlet condition codes for the MPCs.
Definition ASMbase.h:1072
bool addPeriodicity(size_t master, size_t slave, int dir)
Creates and adds a periodicity constraint to this patch.
Definition ASMbase.C:758
const IntVec & getElementNodes(int iel) const
Returns the nodal point correspondance array for an element.
Definition ASMbase.C:302
void makePeriodic(size_t master, size_t slave, int dirs=123)
Creates periodicity constraints between two nodes in this patch.
Definition ASMbase.C:780
BCVec BCode
Array of Boundary Condition codes.
Definition ASMbase.h:1071
void constrainNodes(const IntVec &nodes, int dof, int code=0, bool overrideD=false)
Constrains a list of nodes in the patch.
Definition ASMbase.C:831
static int gEl
Global element counter.
Definition ASMbase.h:1103
bool addLagrangeMultipliers(size_t iel, const IntVec &mGLag, unsigned char nnLag=1)
Adds a set of Lagrange multipliers to the specified element.
Definition ASMbase.C:201
virtual const ASMbase * getOutputMaster() const
Returns the master patch to use for VTF- and HDF5-output.
Definition ASMbase.h:816
std::map< char, size_t > firstBp
Global indices to first integration point for the Neumann boundaries.
Definition ASMbase.h:1096
int searchCtrlPt(RealArray::const_iterator cit, RealArray::const_iterator end, const Vec3 &X, int dimension, double xtol=0.001) const
Helper method used by evalPoint to search for a control point.
Definition ASMbase.C:1755
virtual void printElmInfo(int, const IntegrandBase *) const
Prints out additional app-dependent element information.
Definition ASMbase.h:330
void constrainPatch(int dof, int code=0)
Constrains all nodes in the patch.
Definition ASMbase.C:818
bool isLMn(size_t n) const
Returns true if node n is a Lagrange multiplier node.
Definition ASMbase.h:235
virtual ~ASMbase()
The destructor frees the dynamically allocated data objects.
Definition ASMbase.C:138
virtual void setMinimumSize(double)
Sets the minimum element size for adaptive refinement.
Definition ASMbase.h:189
void printElements(std::ostream &os) const
Prints out element connections of this patch to the given stream.
Definition ASMbase.C:432
static void resetNumbering(int n=0)
Resets the global element and node counters.
Definition ASMbase.C:263
bool isFixed(int node, int dof, bool all=false) const
Checks if the given DOFs are fixed.
Definition ASMbase.C:489
bool add3PC(int slave, int dir, int master1, int master2, int code=0)
Creates and adds a three-point constraint to this patch.
Definition ASMbase.C:575
virtual bool immersedSolution(Matrix &, const Vector &) const
Evaluates the primary solution at the immersed geometry points.
Definition ASMbase.h:637
size_t idx
Index of this patch in the multi-patch model.
Definition ASMbase.h:1051
ASMbase * cloneUnShared() const
Returns a copy of this patch with identical FE discretization.
Definition ASMbase.C:146
std::array< double, 3 > XYZ
Convenience type definition.
Definition ASMbase.h:1116
bool addGlobalLagrangeMultipliers(const IntVec &mGLag, unsigned char nnLag=1)
Adds global Lagrange multipliers to the system.
Definition ASMbase.C:256
virtual bool createProjectionBasis(bool)
Creates a separate projection basis for this patch.
Definition ASMbase.h:805
MPCIter end_MPC() const
Returns the end of the mpcs set.
Definition ASMbase.h:397
virtual void addHole(double, double, double, double, double)
Adds an oval immersed boundary in the physical geometry.
Definition ASMbase.h:141
virtual void findBoundaryElms(IntVec &elms, int lIndex, int orient) const =0
Finds the patch-local element numbers on a patch boundary.
virtual bool getElementCoordinates(Matrix &X, int iel, bool forceItg=false) const =0
Returns a matrix with nodal coordinates for an element.
const IntVec & getGlobalElementNums() const
Returns the global element numbers of this patch.
Definition ASMbase.h:344
size_t firstEl
Global index to first element within this patch.
Definition ASMbase.h:1092
static double modelSize
Characteristic model size.
Definition ASMbase.h:1049
const IntVec & MLGE
Matrix of Local to Global Element numbers.
Definition ASMbase.h:1062
size_t firstIp
Global index to first interior integration point.
Definition ASMbase.h:1093
IntFunc * myElActive
Function returning activation time of an element.
Definition ASMbase.h:1110
virtual void clear(bool retainGeometry=false)
Clears the contents of this patch, making it empty.
Definition ASMbase.C:158
std::vector< char > myLMTypes
Type of Lagrange multiplier ('L' or 'G')
Definition ASMbase.h:1107
virtual ElementBlock * immersedGeometry(char *) const
Returns an additional geometry to visualize (immersed boundaries).
Definition ASMbase.h:613
virtual int evalPoint(const double *xi, double *param, Vec3 &X) const =0
Evaluates the geometry at a specified point.
size_t getElmIndex(int globalNum) const
Returns local 1-based index of element with given global number.
Definition ASMbase.C:290
virtual bool extraSolution(Matrix &, const Vector &) const
Evaluates the primary solution at the extra geometry points.
Definition ASMbase.h:639
virtual void getBoundaryNodes(int lIndex, IntVec &nodes, int basis=0, int thick=1, int orient=-1, bool local=false) const =0
Finds the global (or patch-local) node numbers on a patch boundary.
virtual void setGauss(int ng)
Defines the numerical integration scheme nGauss in the patch.
Definition ASMbase.h:175
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.
Definition ASMbase.C:1616
virtual size_t getNoRefineElms() const
Returns the number of elements on refinement basis for this patch.
Definition ASMbase.h:794
void setElementActivator(IntFunc *efunc)
Sets the element activation function.
Definition ASMbase.h:184
virtual IntMat getElmNodes(int) const
Returns the matrix of nodal point correspondance for given basis.
Definition ASMbase.h:421
virtual void generateProjThreadGroupsFromElms(const IntVec &)
Generates element groups for multi-threading based on a partition.
Definition ASMbase.h:534
bool addMPC(MPC *&mpc, int code=0, bool verbose=false, bool overrideD=false)
Adds a general multi-point-constraint (MPC) equation to this patch.
Definition ASMbase.C:502
virtual void shiftGlobalNodeNums(int nshift)
Increase all global node numbers by nshift.
Definition ASMbase.C:1461
bool extractNodalVec(const RealArray &globVec, RealArray &nodeVec, const int *madof, int ngnod=-1) const
Extracts nodal results for this patch from the global vector.
Definition ASMbase.C:1514
virtual bool integrate(Integrand &integrand, int lIndex, GlobalIntegral &glbInt, const TimeDomain &time)=0
Evaluates a boundary integral over a patch face/edge.
IntVec myElms
Elements on patch - used with partitioning.
Definition ASMbase.h:1080
virtual bool integrateEdge(Integrand &integrand, int lEdge, GlobalIntegral &glbInt, const TimeDomain &time)
Evaluates a boundary integral over a patch edge.
Definition ASMbase.h:566
int fix(size_t inod, int dirs=123)
Constrains DOFs in the given node to zero.
Definition ASMbase.C:938
double getAge(int iel, double time) const
Returns the age of the element with 0-based index iel.
Definition ASMbase.C:1917
const IntVec & getNodeSet(int iset) const
Returns an indexed predefined node set.
Definition ASMbase.C:1959
virtual size_t getNoBasis() const
Returns number of bases of this patch.
Definition ASMbase.h:362
const IntFunc * getElementActivator() const
Returns a pointer to the element activation function.
Definition ASMbase.h:186
virtual size_t getNoNodes(int basis=0) const
Returns the total number of nodes in this patch.
Definition ASMbase.C:329
void getBoundaryElms(int lIndex, IntVec &elms, int orient=-1, bool local=false) const
Finds the global (or patch-local) element numbers on a boundary.
Definition ASMbase.C:1874
unsigned char ndim
Number of parametric dimensions (1, 2 or 3)
Definition ASMbase.h:1055
virtual bool transform(const Matrix &)
Applies a transformation matrix from local to global system.
Definition ASMbase.h:522
virtual void filterResults(Matrix &, const ElementBlock *) const
Filters out result point values that are outside physical domain.
Definition ASMbase.h:617
virtual bool updateCoords(const Vector &displ)=0
Updates the nodal coordinates for this patch.
bool inActive(double time=-1.0) const
Returns true if none of the elements in the patch are active.
Definition ASMbase.C:1897
void printNodes(std::ostream &os) const
Prints out the nodal coordinates of this patch to the given stream.
Definition ASMbase.C:416
static int renumberNodes(const ASM::PatchVec &model, std::map< int, int > &old2new)
Renumbers all global node numbers in the entire model.
Definition ASMbase.C:1325
static int gNod
Global node counter.
Definition ASMbase.h:1104
virtual bool getElementSet(int, std::string &) const
Returns the name of an indexed predefined element set.
Definition ASMbase.h:312
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, bool tangent=false)
Updates the time-dependent in-homogeneous Dirichlet coefficients.
Definition ASMbase.C:1202
static bool deformedConfig(const Matrix &Xnod, Vectors &eVec, bool force2nd=false)
Calculates the deformed configuration for current element.
Definition ASMbase.C:1716
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.
Definition ASMbase.C:683
bool injectNodalVec(const RealArray &nodeVec, RealArray &globVec, const IntVec &madof, int basis=0) const
Injects nodal results for this patch into the global vector.
Definition ASMbase.C:1563
bool L2projection(Matrix &sField, IntegrandBase *integrand, const TimeDomain &time)
Projects the secondary solution using a continuous global L2-fit.
Definition GlbL2projector.C:535
void setGlobalNodeNums(const IntVec &nodes)
Sets the global node numbers for this patch.
Definition ASMbase.h:335
virtual bool getOrder(int &, int &, int &) const
Returns the polynomial order in each parameter direction.
Definition ASMbase.h:212
virtual void getNoIntPoints(size_t &nPt, size_t &nIPt)
Computes the total number of integration points in this patch.
Definition ASMbase.C:360
int nGauss
Numerical integration scheme for this patch.
Definition ASMbase.h:1090
virtual unsigned char getNodalDOFs(size_t inod) const
Returns the number of DOFs per node.
Definition ASMbase.C:312
void setActiveElements(IntVec *active)
Sets the list of active elements during assembly.
Definition ASMbase.h:347
virtual int parseNodeBox(const std::string &, const char *)
Defines a node set by parsing a 3D bounding box.
Definition ASMbase.h:303
IntMat::const_iterator begin_elm() const
Returns the beginning of the MNPC array.
Definition ASMbase.h:390
virtual void getElmConnectivities(IntMat &neighs, int basis=ASM::INTEGRATION_BASIS) const =0
Calculates the matrix of element neighbour connectivities.
virtual size_t getNoBoundaryElms(char, char) const
Returns the number of elements on a boundary.
Definition ASMbase.h:375
unsigned char getNoLagPerNode() const
Returns the number of Lagrange multipliers per node.
Definition ASMbase.h:209
virtual void setNodeNumbers(const IntVec &nodes)
Sets the global node numbers for this patch.
Definition ASMbase.C:1174
virtual bool write(std::ostream &os, int basis=0) const =0
Writes the geometry/basis of the patch to the given stream.
virtual size_t getNoRefineNodes() const
Returns the number of nodes on refinement basis for this patch.
Definition ASMbase.h:791
int getMaxElmNo() const
Returns the highest external element number in this patch.
Definition ASMbase.C:354
virtual bool isInElementSet(int, int) const
Checks if an element is within a predefined element set.
Definition ASMbase.h:314
virtual void generateThreadGroups(const Integrand &, bool, bool)
Generates element groups for multi-threading of interior integrals.
Definition ASMbase.h:528
static bool fixHomogeneousDirichlet
If true, pre-eliminate fixed DOFs.
Definition ASMbase.h:1045
int prescribe(size_t inod, int dirs, int code, bool overrideD=false)
Constrains DOFs in the given node to the given value.
Definition ASMbase.C:859
bool isElementActive(int iel, double time=-1.0) const
Returns true if element with 0-based index iel is active.
Definition ASMbase.C:1885
virtual bool read(std::istream &is)=0
Creates an instance by reading the given input stream.
virtual double getMinimumSize(int=0) const
Defines the minimum element size for adaptive refinement.
Definition ASMbase.h:191
virtual bool validateThreadGroups(const SAM *) const
Validates the threading groups based on the assembly data in SAM.
Definition ASMbase.h:536
void addRigidCouplings(int gMaster, const Vec3 &Xmaster, const IntVec &slaveNodes)
Adds MPC-equations representing a rigid coupling to this patch.
Definition ASMbase.C:703
BCVec::const_iterator end_BC() const
Returns the end of the BCode array.
Definition ASMbase.h:387
IntVec myMLGE
The actual Matrix of Local to Global Element numbers.
Definition ASMbase.h:1077
virtual Vec3 getCoord(size_t inod) const =0
Returns the global coordinates for the given node.
bool isShared() const
Returns true if this patch shares FE data with another patch.
Definition ASMbase.h:404
virtual Vec3 getElementCenter(int) const =0
Returns the coordinates of the element center.
BCVec::const_iterator begin_BC() const
Returns the beginning of the BCode array.
Definition ASMbase.h:385
MPC * findMPC(int node, int dof) const
Returns a pointer to the MPC object for a specified slave, if any.
Definition ASMbase.C:750
bool mergeNodes(size_t inod, int globalNum, bool verbose=true)
Merges a given node in this patch with a given global node.
Definition ASMbase.C:1303
bool isElementInPartition(int iel) const
Returns true if element is in process partition.
Definition ASMbase.C:1940
virtual bool selfInterconnect(const std::vector< Ipair > &nodes, double xtol=1.0e-8)
Connects a list of node pairs to each other.
Definition ASMbase.C:795
std::vector< BC > BCVec
Nodal boundary condition container.
Definition ASMbase.h:94
unsigned char nsd
Number of space dimensions (ndim <= nsd <= 3)
Definition ASMbase.h:1056
std::map< size_t, XYZ > myRmaster
Rigid master nodal points.
Definition ASMbase.h:1117
virtual char getNodeType(size_t inod) const
Returns the classification of a node.
Definition ASMbase.C:323
virtual bool evaluate(const ASMbase *basis, const Vector &locVec, RealArray &vec, int basisNum=1) const
Evaluates and interpolates a field over a given geometry.
Definition ASMbase.C:1841
virtual void initMADOF(const int *)
Initializes the patch level MADOF array for mixed problems.
Definition ASMbase.h:525
std::set< size_t > myLMs
Nodal indices of the Lagrange multipliers.
Definition ASMbase.h:1108
virtual bool empty() const =0
Checks if this patch is empty.
virtual void swapProjectionBasis()
Swap between main and alternative projection basis.
Definition ASMbase.h:809
virtual bool integrate(Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time, const ASM::InterfaceChecker &iChk)
Evaluates an integral over element interfaces in the patch.
Definition ASMbase.h:575
static void resolveMPCchains(const MPCSet &allMPCs, const ASM::PatchVec &model, bool setPtrOnly=false)
Resolves (possibly multi-level) chaining in MPC-equations.
Definition ASMbase.C:1070
int getNoGaussPt(int p, bool neumann=false) const
Returns the number of Gauss points to use in one direction.
Definition ASMbase.C:1784
virtual ElementBlock * extraGeometry(char *) const
Returns an additional geometry to visualize (spiders, etc.).
Definition ASMbase.h:615
virtual bool getParameterDomain(Real2DMat &u, IntVec *corners=nullptr) const =0
Returns parameter values and node numbers of the domain corners.
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.
Definition ASMbase.C:1797
void addNodalCouplings(int slave, const IntVec &masters, const RealArray &weights)
Adds MPC-equations for general nodal couplings in this patch.
Definition ASMbase.C:735
int getNodeSetIdx(const std::string &setName) const
Returns (1-based) index of a predefined node set in the patch.
Definition ASMbase.C:1946
virtual unsigned char getNoFields(int b=0) const
Returns the number of solution fields.
Definition ASMbase.h:207
virtual void shiftGlobalElmNums(int eshift)
Increase all global element numbers by eshift.
Definition ASMbase.C:1474
virtual int parseElemBox(const std::string &, const std::string &, const char *)
Defines an element set by parsing a 3D bounding box.
Definition ASMbase.h:318
IntMat myMNPC
The actual Matrix of Nodal Point Correspondance.
Definition ASMbase.h:1079
virtual void copyParameterDomain(const ASMbase *)
Copies the parameter domain from another patch.
Definition ASMbase.h:428
size_t getNoMPCs() const
Returns the total number of multi-point constraint equations.
Definition ASMbase.h:377
const char shareFE
Flag telling whether this patch shares its data with another patch.
Definition ASMbase.h:1069
virtual void generateThreadGroups(char, bool, bool)
Generates element groups for multi-threading of boundary integrals.
Definition ASMbase.h:530
ASM::PatchVec neighbors
Patches having nodes in common with this one.
Definition ASMbase.h:1098
Class for storage of a standard FE grid block.
Definition ElementBlock.h:27
Interface class for scalar fields.
Definition Field.h:30
Base class for vector fields.
Definition Fields.h:35
Base class for unary spatial functions of arbitrary result type.
Definition Function.h:147
Abstract base class representing a system level integrated quantity.
Definition GlobalIntegral.h:29
A real-valued integer function.
Definition Functions.h:617
Base class representing a system level integrated quantity.
Definition IntegrandBase.h:42
Abstract base class representing a system level integrated quantity.
Definition Integrand.h:44
Abstract class for evaluating integrand or function.
Definition GlbL2projector.h:40
A class representing a general multi-point constraint equation.
Definition MPC.h:52
Scalar-valued unary function of a spatial point.
Definition Function.h:193
This class contains data and functions for the assembly of FE matrices.
Definition SAM.h:39
Base class for representing a system matrix on different formats.
Definition SystemMatrix.h:220
Base class for representing a system vector on different formats.
Definition SystemMatrix.h:32
Simple class for representing a non-symmetric second-order tensor.
Definition Tensor.h:28
Simple class for representing a point in 3D space.
Definition Vec3.h:27
Vector-valued unary function of a spatial point.
Definition Function.h:242
A vector class with some added algebraic operations.
Definition matrix.h:64
Assembly scope.
Definition SIMdummy.h:24
@ INTEGRATION_BASIS
Integration basis.
Definition ASMenums.h:58
std::pair< std::string, IntVec > NodeSet
Named set container type.
Definition ASMbase.h:54
std::vector< ASMbase * > PatchVec
Spline patch container type.
Definition ASMbase.h:55
Struct for boundary condition codes.
Definition ASMbase.h:76
char RX
Boundary condition code for X-rotation.
Definition ASMbase.h:81
BC(int n)
Constructor initializing a BC instance.
Definition ASMbase.h:86
char RZ
Boundary condition code for Z-rotation.
Definition ASMbase.h:83
int node
Global node number of the constrained node.
Definition ASMbase.h:77
char CZ
Boundary condition code for Z-translation.
Definition ASMbase.h:80
char RY
Boundary condition code for Y-rotation.
Definition ASMbase.h:82
char CX
Boundary condition code for X-translation.
Definition ASMbase.h:78
char CY
Boundary condition code for Y-translation.
Definition ASMbase.h:79
int free(int dof)
Removes the fixation in local dof dof.
Definition ASMbase.C:908
int fix(int dof)
Fixes local dof dof.
Definition ASMbase.C:923
Struct representing the time domain.
Definition TimeDomain.h:23