28 using MPCMap = std::map<MPC*,int,MPCLess>;
29 using MPCSet = std::set<MPC*,MPCLess>;
50 namespace ASM {
class InterfaceChecker; }
51 namespace utl {
template<
class Arg,
class Result>
class Function; }
53 using ASMVec = std::vector<ASMbase*>;
99 ASMbase(
unsigned char n_p,
unsigned char n_s,
unsigned char n_f);
130 virtual bool read(std::istream& is) = 0;
132 virtual bool readBasis(std::istream&,
size_t) {
return false; }
134 virtual bool write(std::ostream& os,
int basis = 0)
const = 0;
137 virtual void addHole(
double,
double,
double) {}
139 virtual void addHole(
double,
double,
double,
double,
double) {}
149 virtual void clear(
bool retainGeometry =
false);
156 virtual bool addXElms(
short int dim,
short int item,
size_t nXn,
164 unsigned char nnLag = 1);
170 unsigned char nnLag = 1);
205 virtual unsigned char getNoFields(
int b = 0)
const {
return b > 1 ? 0 :
nf; }
210 virtual bool getOrder(
int&,
int&,
int&)
const {
return false; }
215 virtual size_t getNodeIndex(
int globalNum,
bool =
false)
const;
218 virtual int getNodeID(
size_t inod,
bool =
false)
const;
254 bool forceItg =
false)
const = 0;
266 int basis = 0,
int thick = 1,
267 int orient = -1,
bool local =
false)
const = 0;
277 int basis = 0,
int orient = -1,
278 bool local =
false,
bool open =
false)
const {}
286 int orient = -1,
bool local =
false)
const;
295 virtual int parseNodeSet(
const std::string&,
const char*) {
return 0; }
297 virtual int parseNodeBox(
const std::string&,
const char*) {
return 0; }
308 virtual int parseElemSet(
const std::string&,
const char*) {
return 0; }
311 const char*) {
return 0; }
315 {
return { 0, -1 }; }
345 double getAge(
int iel,
double time)
const;
356 virtual size_t getNoNodes(
int basis = 0)
const;
362 size_t getNoElms(
bool includeZeroVolElms =
false,
363 bool includeXElms =
false)
const;
404 IntVec* corners =
nullptr)
const = 0;
461 const std::vector<int>& new2old = {},
int renumGN = 0,
462 std::map<int,int>* degenElm =
nullptr);
480 const ASMVec& model,
bool setPtrOnly =
false);
493 const std::map<int,VecFunc*>& vfunc);
501 const std::map<int,VecFunc*>& vfunc,
503 const std::map<int,int>* g2l =
nullptr);
573 const double* u,
const Vec3& p) {
return false; }
612 const IntVec& nodes)
const;
621 const int* npe,
int n_f = 0,
622 bool piola =
false)
const;
635 const int* npe,
int n_f = 0)
const
636 {
return this->
evalSolution(sField, locSol, npe, n_f); }
652 const RealArray* gpar,
bool regular =
true,
653 int deriv = 0,
int n_f = 0)
const;
667 const RealArray* gpar,
bool regular)
const;
689 int basisNum = 1,
double time = 0.0)
const;
705 const int* npe =
nullptr,
char project = 0)
const;
721 const RealArray* gpar,
bool regular =
true)
const;
733 const IntVec& elements)
const;
742 bool continuous =
false,
743 bool enforceEnds =
false)
const;
773 const std::vector<FunctionBase*>&
function,
double t = 0.0);
810 size_t internalFirst = 0)
const;
818 size_t internalFirst = 0)
const;
826 const int* madof,
int ngnod = -1)
const;
834 unsigned char nndof = 0,
int basis = 0)
const;
842 unsigned char nndof = 0,
int basis = 0)
const;
850 const IntVec& madof,
int basis = 0)
const;
857 bool add2PC(
int slave,
int dir,
int master,
int code = 0);
865 bool verbose =
false,
bool overrideD =
false);
875 virtual bool addRigidCpl(
int lindx,
int ldim,
int basis,
876 int& gMaster,
const Vec3& Xmaster,
877 bool extraPt =
true);
884 const IntVec& slaveNodes);
902 bool add3PC(
int slave,
int dir,
int master1,
int master2,
int code = 0);
912 void makePeriodic(
size_t master,
size_t slave,
int dirs = 123);
942 int searchCtrlPt(RealArray::const_iterator cit, RealArray::const_iterator end,
943 const Vec3& X,
int dimension,
double tol = 0.001)
const;
958 bool continuous)
const {
return false; }
975 bool overrideD =
false);
989 int prescribe(
size_t inod,
int dirs,
int code,
bool overrideD =
false);
994 int fix(
size_t inod,
int dirs = 123);
999 bool isFixed(
int node,
int dof,
bool all =
false)
const;
1010 bool force2nd =
false);
1018 bool writeLagBasis(std::ostream& os,
const char* type)
const;
1089 using XYZ = std::array<double,3>;
MPCSet::const_iterator MPCIter
Iterator over an MPC-equation set.
Definition: ASMbase.h:30
std::set< MPC *, MPCLess > MPCSet
Sorted set of MPC-equations.
Definition: ASMbase.h:29
std::vector< ASMbase * > ASMVec
Spline patch container type.
Definition: ASMbase.h:53
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:28
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:29
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:70
virtual ElementBlock * immersedGeometry(char *) const
Returns an additional geometry to visualize (immersed boundaries).
Definition: ASMbase.h:601
virtual int getElementSetIdx(const std::string &) const
Returns (1-based) index of a predefined element set in the patch.
Definition: ASMbase.h:300
size_t nel
Number of regular elements in this patch.
Definition: ASMbase.h:1035
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:513
MPCIter begin_MPC() const
Returns the beginning of the mpcs set.
Definition: ASMbase.h:387
virtual int getNodeID(size_t inod, bool=false) const
Returns the global node number for the given node.
Definition: ASMbase.C:274
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:1586
virtual bool setGeometry(RealFunc *, double, double)
Defines the immersed geometry from a scalar function.
Definition: ASMbase.h:141
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:1797
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:1748
size_t getNoElms(bool includeZeroVolElms=false, bool includeXElms=false) const
Returns the total number of elements in this patch.
Definition: ASMbase.C:337
unsigned char nLag
Number of Lagrange multipliers per node.
Definition: ASMbase.h:1034
const IntFunc * getElementActivator() const
Returns a pointer to the element activation function.
Definition: ASMbase.h:184
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:1040
IntVec * myActiveEls
List of active elements during element assembly.
Definition: ASMbase.h:1085
const IntVec & MLGN
Matrix of Local to Global Node numbers.
Definition: ASMbase.h:1039
int getElmID(size_t iel) const
Returns the global element number for the given element.
Definition: ASMbase.C:293
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:192
virtual bool assembleL2matrices(SystemMatrix &A, SystemVector &B, const L2Integrand &obj, bool continuous) const
Assembles L2-projection matrices for the secondary solution.
Definition: ASMbase.h:956
virtual const IntVec & getNodeSet(int) const
Returns an indexed predefined node set.
Definition: ASMbase.h:291
static int dbgElm
One-based element index to print debugging info for.
Definition: ASMbase.h:1023
static std::map< int, int > xNode
Auxilliary node number map used when establishing Dirichlet constraints.
Definition: ASMbase.h:1075
virtual void closeBoundaries(int dir=1, int basis=0, int master=1)
Makes two opposite boundaries periodic.
Definition: ASMbase.h:426
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:527
virtual int parseElemSet(const std::string &, const char *)
Defines an element set by parsing a list of element numbers.
Definition: ASMbase.h:308
void addRigidMPC(int gSlave, int gMaster, const Vec3 &dX)
Adds MPC-equations representing a rigid arm to a 6-DOF node.
Definition: ASMbase.C:646
char getLMType(size_t inod) const
Returns the type of a Lagrange multiplier node.
Definition: ASMbase.C:280
virtual bool separateProjectionBasis() const
Checks if a separate projection basis is used for this patch.
Definition: ASMbase.h:795
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:1049
IntVec myMLGN
The actual Matrix of Local to Global Node numbers.
Definition: ASMbase.h:1052
virtual bool checkElementSize(int, bool=true) const
Checks if the specified element is larger than the minimum size.
Definition: ASMbase.h:191
virtual void generateThreadGroupsFromElms(const IntVec &)
Generates element groups for multi-threading based on a partition.
Definition: ASMbase.h:520
static int renumberNodes(const ASMVec &model, std::map< int, int > &old2new)
Renumbers all global node numbers in the entire model.
Definition: ASMbase.C:1260
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:634
virtual void addHole(double, double, double)
Adds a circular immersed boundary in the physical geometry.
Definition: ASMbase.h:137
static IntVec Empty
Empty integer vector used when a reference is needed.
Definition: ASMbase.h:1086
virtual Fields * getProjectedFields(const Vector &, size_t) const
Returns a field using the projection basis.
Definition: ASMbase.h:789
virtual bool initConstraints()
Initializes the multi-point constraint coefficients.
Definition: ASMbase.h:483
static bool collapseNodes(ASMbase &pch1, int node1, ASMbase &pch2, int node2)
Collapses the given two nodes into one.
Definition: ASMbase.C:1215
virtual int parseNodeSet(const std::string &, const char *)
Defines a node set by parsing a list of node numbers.
Definition: ASMbase.h:295
unsigned char nf
Number of primary solution fields (1 or larger)
Definition: ASMbase.h:1033
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:276
virtual std::pair< size_t, double > findClosestNode(const Vec3 &) const
Finds the node that is closest to the given point.
Definition: ASMbase.h:314
void setNoFields(unsigned char n)
Defines the number of solution fields in the patch.
Definition: ASMbase.h:179
virtual void getNoBouPoints(size_t &nPt, char ldim, char lindx)
Computes the number of boundary integration points in this patch.
Definition: ASMbase.C:385
virtual size_t getNoProjectionNodes() const
Returns the number of projection nodes for this patch.
Definition: ASMbase.h:776
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:551
unsigned char getNoSpaceDim() const
Returns the number of spatial dimensions.
Definition: ASMbase.h:201
virtual bool getSolution(Matrix &sField, const Vector &locSol, const IntVec &nodes) const
Extract the primary solution field at the specified nodes.
Definition: ASMbase.C:1620
bool constrainXnode(int node, int dof, int code=0)
Constrains an extraordinary node in the patch.
Definition: ASMbase.C:801
virtual size_t getNodeIndex(int globalNum, bool=false) const
Returns local 1-based index of the node with given global number.
Definition: ASMbase.C:268
virtual bool readBasis(std::istream &, size_t)
Reads a basis from the given input stream.
Definition: ASMbase.h:132
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:203
void addLocal2GlobalCpl(int iSlave, int master, const Tensor &Tlg)
Creates constraint equations coupling global DOFs to local DOFs.
Definition: ASMbase.C:588
void addNeighbor(ASMbase *pch)
Adds a patch to the list of neighbors of this patch.
Definition: ASMbase.C:1205
IntMat::const_iterator end_elm() const
Returns the end of the MNPC array.
Definition: ASMbase.h:384
bool hasXNodes() const
Returns true if this patch has additional (extraordinary) nodes.
Definition: ASMbase.h:398
bool isRMn(size_t n) const
Returns true if node n is a master node of a rigid coupling.
Definition: ASMbase.h:235
const IntVec & getGlobalNodeNums() const
Returns the global node numbers of this patch.
Definition: ASMbase.h:331
virtual 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:1417
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:572
bool allDofs(int dirs) const
Returns true if dirs constains all local DOFs in the patch.
Definition: ASMbase.C:928
size_t nnod
Number of regular nodes in this patch.
Definition: ASMbase.h:1036
const IntVec & getGlobalElementNums() const
Returns the global element numbers of this patch.
Definition: ASMbase.h:336
bool createRgdMasterNode(int &gMaster, const Vec3 &Xmaster)
Creates an additional master node for a rigid coupling.
Definition: ASMbase.C:628
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:1136
MPCMap dCode
Inhomogeneous Dirichlet condition codes for the MPCs.
Definition: ASMbase.h:1048
bool addPeriodicity(size_t master, size_t slave, int dir)
Creates and adds a periodicity constraint to this patch.
Definition: ASMbase.C:740
const IntVec & getElementNodes(int iel) const
Returns the nodal point correspondance array for an element.
Definition: ASMbase.C:299
void makePeriodic(size_t master, size_t slave, int dirs=123)
Creates periodicity constraints between two nodes in this patch.
Definition: ASMbase.C:762
virtual Field * getProjectedField(const Vector &) const
Returns a field using the projection basis.
Definition: ASMbase.h:785
BCVec BCode
Array of Boundary Condition codes.
Definition: ASMbase.h:1047
void constrainNodes(const IntVec &nodes, int dof, int code=0, bool overrideD=false)
Constrains a list of nodes in the patch.
Definition: ASMbase.C:786
static int gEl
Global element counter.
Definition: ASMbase.h:1077
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:198
std::map< char, size_t > firstBp
Global indices to first integration point for the Neumann boundaries.
Definition: ASMbase.h:1070
virtual void printElmInfo(int, const IntegrandBase *) const
Prints out additional app-dependent element information.
Definition: ASMbase.h:322
void constrainPatch(int dof, int code=0)
Constrains all nodes in the patch.
Definition: ASMbase.C:773
bool isLMn(size_t n) const
Returns true if node n is a Lagrange multiplier node.
Definition: ASMbase.h:233
virtual ~ASMbase()
The destructor frees the dynamically allocated data objects.
Definition: ASMbase.C:135
virtual void setMinimumSize(double)
Sets the minimum element size for adaptive refinement.
Definition: ASMbase.h:187
void printElements(std::ostream &os) const
Prints out element connections of this patch to the given stream.
Definition: ASMbase.C:429
static void resetNumbering(int n=0)
Resets the global element and node counters.
Definition: ASMbase.C:260
bool isFixed(int node, int dof, bool all=false) const
Checks if the given DOFs are fixed.
Definition: ASMbase.C:483
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:568
virtual bool immersedSolution(Matrix &, const Vector &) const
Evaluates the primary solution at the immersed geometry points.
Definition: ASMbase.h:625
size_t idx
Index of this patch in the multi-patch model.
Definition: ASMbase.h:1027
ASMbase * cloneUnShared() const
Returns a copy of this patch with identical FE discretization.
Definition: ASMbase.C:143
std::array< double, 3 > XYZ
Convenience type definition.
Definition: ASMbase.h:1089
bool addGlobalLagrangeMultipliers(const IntVec &mGLag, unsigned char nnLag=1)
Adds global Lagrange multipliers to the system.
Definition: ASMbase.C:253
virtual bool createProjectionBasis(bool)
Creates a separate projection basis for this patch.
Definition: ASMbase.h:793
MPCIter end_MPC() const
Returns the end of the mpcs set.
Definition: ASMbase.h:389
virtual void addHole(double, double, double, double, double)
Adds an oval immersed boundary in the physical geometry.
Definition: ASMbase.h:139
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.
size_t firstEl
Global index to first element within this patch.
Definition: ASMbase.h:1066
static double modelSize
Characteristic model size.
Definition: ASMbase.h:1025
const IntVec & MLGE
Matrix of Local to Global Element numbers.
Definition: ASMbase.h:1038
size_t firstIp
Global index to first interior integration point.
Definition: ASMbase.h:1067
IntFunc * myElActive
Function returning activatiation time of element.
Definition: ASMbase.h:1084
virtual void clear(bool retainGeometry=false)
Clears the contents of this patch, making it empty.
Definition: ASMbase.C:155
std::vector< char > myLMTypes
Type of Lagrange multiplier ('L' or 'G')
Definition: ASMbase.h:1081
ASMbase(unsigned char n_p, unsigned char n_s, unsigned char n_f)
The constructor sets the number of space dimensions and fields.
Definition: ASMbase.C:59
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:287
virtual bool extraSolution(Matrix &, const Vector &) const
Evaluates the primary solution at the extra geometry points.
Definition: ASMbase.h:627
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:173
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:1554
virtual size_t getNoRefineElms() const
Returns the number of elements on refinement basis for this patch.
Definition: ASMbase.h:782
void setElementActivator(IntFunc *efunc)
Sets the element activation function.
Definition: ASMbase.h:182
virtual IntMat getElmNodes(int) const
Returns the matrix of nodal point correspondance for given basis.
Definition: ASMbase.h:413
virtual void generateProjThreadGroupsFromElms(const IntVec &)
Generates element groups for multi-threading based on a partition.
Definition: ASMbase.h:522
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:496
virtual void shiftGlobalNodeNums(int nshift)
Increase all global node numbers by nshift.
Definition: ASMbase.C:1397
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:1452
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.
Definition: ASMbase.C:1693
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:1054
virtual bool integrateEdge(Integrand &integrand, int lEdge, GlobalIntegral &glbInt, const TimeDomain &time)
Evaluates a boundary integral over a patch edge.
Definition: ASMbase.h:554
int fix(size_t inod, int dirs=123)
Constrains DOFs in the given node to zero.
Definition: ASMbase.C:893
double getAge(int iel, double time) const
Returns the age of the element with 0-based index iel.
Definition: ASMbase.C:1843
virtual size_t getNoBasis() const
Returns number of bases of this patch.
Definition: ASMbase.h:354
virtual size_t getNoNodes(int basis=0) const
Returns the total number of nodes in this patch.
Definition: ASMbase.C:326
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:1812
unsigned char ndim
Number of parametric dimensions (1, 2 or 3)
Definition: ASMbase.h:1031
virtual bool isInNodeSet(int, int) const
Checks if a node is within a predefined node set.
Definition: ASMbase.h:293
virtual bool transform(const Matrix &)
Applies a transformation matrix from local to global system.
Definition: ASMbase.h:510
virtual void filterResults(Matrix &, const ElementBlock *) const
Filters out result point values that are outside physical domain.
Definition: ASMbase.h:605
virtual bool updateCoords(const Vector &displ)=0
Updates the nodal coordinates for this patch.
void printNodes(std::ostream &os) const
Prints out the nodal coordinates of this patch to the given stream.
Definition: ASMbase.C:413
static int gNod
Global node counter.
Definition: ASMbase.h:1078
virtual bool getElementSet(int, std::string &) const
Returns the name of an indexed predefined element set.
Definition: ASMbase.h:304
static bool deformedConfig(const Matrix &Xnod, Vectors &eVec, bool force2nd=false)
Calculates the deformed configuration for current element.
Definition: ASMbase.C:1654
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:678
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:1501
bool L2projection(Matrix &sField, IntegrandBase *integrand, const TimeDomain &time)
Projects the secondary solution using a continuous global L2-fit.
Definition: GlbL2projector.C:472
void setGlobalNodeNums(const IntVec &nodes)
Sets the global node numbers for this patch.
Definition: ASMbase.h:327
virtual bool getOrder(int &, int &, int &) const
Returns the polynomial order in each parameter direction.
Definition: ASMbase.h:210
virtual void getNoIntPoints(size_t &nPt, size_t &nIPt)
Computes the total number of integration points in this patch.
Definition: ASMbase.C:357
int nGauss
Numerical integration scheme for this patch.
Definition: ASMbase.h:1064
virtual unsigned char getNodalDOFs(size_t inod) const
Returns the number of DOFs per node.
Definition: ASMbase.C:309
void setActiveElements(IntVec *active)
Sets the list of active elements during assembly.
Definition: ASMbase.h:339
virtual int getNodeSetIdx(const std::string &) const
Returns (1-based) index of a predefined node set in the patch.
Definition: ASMbase.h:289
virtual int parseNodeBox(const std::string &, const char *)
Defines a node set by parsing a 3D bounding box.
Definition: ASMbase.h:297
IntMat::const_iterator begin_elm() const
Returns the beginning of the MNPC array.
Definition: ASMbase.h:382
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:367
unsigned char getNoLagPerNode() const
Returns the number of Lagrange multipliers per node.
Definition: ASMbase.h:207
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.
Definition: ASMbase.C:1157
bool inActive(double time) const
Returns true if none of the elements in the patch are active.
Definition: ASMbase.C:1829
virtual void setNodeNumbers(const IntVec &nodes)
Sets the global node numbers for this patch.
Definition: ASMbase.C:1129
const IntVec & getMyNodeNums() const
Returns the actual global node numbers of this patch.
Definition: ASMbase.h:329
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:779
int getMaxElmNo() const
Returns the highest external element number in this patch.
Definition: ASMbase.C:351
virtual bool isInElementSet(int, int) const
Checks if an element is within a predefined element set.
Definition: ASMbase.h:306
virtual void generateThreadGroups(const Integrand &, bool, bool)
Generates element groups for multi-threading of interior integrals.
Definition: ASMbase.h:516
static bool fixHomogeneousDirichlet
If true, pre-eliminate fixed DOFs.
Definition: ASMbase.h:1021
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:814
bool isElementActive(int iel, double time=-1.0) const
Returns true if element with 0-based index iel is active.
Definition: ASMbase.C:1823
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:189
virtual bool validateThreadGroups(const SAM *) const
Validates the threading groups based on the assembly data in SAM.
Definition: ASMbase.h:524
void addRigidCouplings(int gMaster, const Vec3 &Xmaster, const IntVec &slaveNodes)
Adds MPC-equations representing a rigid coupling to this patch.
Definition: ASMbase.C:698
BCVec::const_iterator end_BC() const
Returns the end of the BCode array.
Definition: ASMbase.h:379
virtual ElementBlock * extraGeometry(char *) const
Returns an additional geometry to visualize (spiders, etc.).
Definition: ASMbase.h:603
ASMVec neighbors
Patches having nodes in common with this one.
Definition: ASMbase.h:1072
IntVec myMLGE
The actual Matrix of Local to Global Element numbers.
Definition: ASMbase.h:1051
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:396
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:377
MPC * findMPC(int node, int dof) const
Returns a pointer to the MPC object for a specified slave, if any.
Definition: ASMbase.C:732
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:1238
bool isElementInPartition(int iel) const
Returns true if element is in process partition.
Definition: ASMbase.C:1866
virtual const IntVec & getElementSet(int) const
Returns an indexed predefined element set.
Definition: ASMbase.h:302
std::vector< BC > BCVec
Nodal boundary condition container.
Definition: ASMbase.h:92
unsigned char nsd
Number of space dimensions (ndim <= nsd <= 3)
Definition: ASMbase.h:1032
std::map< size_t, XYZ > myRmaster
Rigid master nodal points.
Definition: ASMbase.h:1090
virtual char getNodeType(size_t inod) const
Returns the classification of a node.
Definition: ASMbase.C:320
static void mergeAndGetAllMPCs(const ASMVec &model, MPCSet &allMPCs)
Computes the set of all MPC-equations over the whole model.
Definition: ASMbase.C:939
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:1779
virtual void initMADOF(const int *)
Initializes the patch level MADOF array for mixed problems.
Definition: ASMbase.h:513
std::set< size_t > myLMs
Nodal indices of the Lagrange multipliers.
Definition: ASMbase.h:1082
virtual bool empty() const =0
Checks if this patch is empty.
static void resolveMPCchains(const MPCSet &allMPCs, const ASMVec &model, bool setPtrOnly=false)
Resolves (possibly multi-level) chaining in MPC-equations.
Definition: ASMbase.C:1025
virtual void swapProjectionBasis()
Swap between main and alternative projection basis.
Definition: ASMbase.h:797
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:563
int getNoGaussPt(int p, bool neumann=false) const
Returns the number of Gauss points to use in one direction.
Definition: ASMbase.C:1722
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:1735
virtual unsigned char getNoFields(int b=0) const
Returns the number of solution fields.
Definition: ASMbase.h:205
virtual void shiftGlobalElmNums(int eshift)
Increase all global element numbers by eshift.
Definition: ASMbase.C:1410
virtual int parseElemBox(const std::string &, const std::string &, const char *)
Defines an element set by parsing a 3D bounding box.
Definition: ASMbase.h:310
IntMat myMNPC
The actual Matrix of Nodal Point Correspondance.
Definition: ASMbase.h:1053
virtual void copyParameterDomain(const ASMbase *)
Copies the parameter domain from another patch.
Definition: ASMbase.h:420
size_t getNoMPCs() const
Returns the total number of multi-point constraint equations.
Definition: ASMbase.h:369
const char shareFE
Flag telling whether this patch shares its data with another patch.
Definition: ASMbase.h:1045
virtual void generateThreadGroups(char, bool, bool)
Generates element groups for multi-threading of boundary integrals.
Definition: ASMbase.h:518
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
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:39
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
Base class for unary functions of arbitrary result and argument type.
Definition: Function.h:31
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
Go::SplineCurve * project(const Go::SplineCurve *curve, const FunctionBase &f, int nComp=1, Real time=Real(0))
Projects a spatial function onto a spline curve.
Definition: SplineUtils.C:204
bool verbose
If true, print out some Arnoldi iteration info.
Definition: EigSolver.C:100
General utility classes and functions.
Definition: SIMoptions.h:22
Struct for boundary condition codes.
Definition: ASMbase.h:74
char RX
Boundary condition code for X-rotation.
Definition: ASMbase.h:79
BC(int n)
Constructor initializing a BC instance.
Definition: ASMbase.h:84
char RZ
Boundary condition code for Z-rotation.
Definition: ASMbase.h:81
int node
Global node number of the constrained node.
Definition: ASMbase.h:75
char CZ
Boundary condition code for Z-translation.
Definition: ASMbase.h:78
char RY
Boundary condition code for Y-rotation.
Definition: ASMbase.h:80
char CX
Boundary condition code for X-translation.
Definition: ASMbase.h:76
char CY
Boundary condition code for Y-translation.
Definition: ASMbase.h:77
int free(int dof)
Removes the fixation in local dof dof.
Definition: ASMbase.C:863
int fix(int dof)
Fixes local dof dof.
Definition: ASMbase.C:878
Struct representing the time domain.
Definition: TimeDomain.h:23