IFEM  90A354
ASMs2D.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _ASM_S2D_H
15 #define _ASM_S2D_H
16 
17 #include "ASMstruct.h"
18 #include "ASM2D.h"
19 #include "BasisFunctionCache.h"
20 #include "Interface.h"
21 #include "ThreadGroups.h"
22 
23 namespace utl {
24  class Point;
25 }
26 
27 namespace Go {
28  class SplineCurve;
29  class SplineSurface;
30 }
31 
32 
38 class ASMs2D : public ASMstruct, public ASM2D
39 {
41  struct IJ
42  {
43  int I;
44  int J;
45  };
46 
47  typedef std::vector<IJ> IndexVec;
48 
50  struct Edge
51  {
52  int icnod;
53  int incr;
54 
56  Edge() { icnod = incr = 0; }
58  int next();
59  };
60 
61 protected:
64  {
65  public:
68  BasisFunctionCache(const ASMs2D& pch);
69 
73  BasisFunctionCache(const BasisFunctionCache& cache, int b);
74 
76  virtual ~BasisFunctionCache() = default;
77 
79  const std::array<size_t,2>& noElms() const { return nel; }
80 
81  protected:
83  bool internalInit() override;
84 
89  BasisFunctionVals calculatePt(size_t el, size_t gp, bool reduced) const override;
90 
92  void calculateAll() override;
93 
98  size_t index(size_t el, size_t gp, bool reduced) const override;
99 
101  virtual void setupParameters();
102 
104  bool setupQuadrature();
105 
106  const ASMs2D& patch;
107 
108  std::array<size_t,2> nel{};
109 
110  private:
113  std::array<size_t,2> elmIndex(size_t el) const;
114  };
115 
116 public:
118  struct BlockNodes
119  {
120  int ibnod[4];
121  Edge edges[4];
122  int iinod;
123  int inc[2];
124  int nnodI;
125  int indxI;
126 
129  {
130  memset(ibnod,0,4*sizeof(int));
131  iinod = inc[0] = inc[1] = nnodI = 0;
132  indxI = 1;
133  }
135  int next();
136  };
137 
138 private:
139  typedef std::pair<int,int> Ipair;
140 
143  {
144  Go::SplineCurve* curve;
145  int dof;
146  int code;
147  std::vector<Ipair> nodes;
148 
150  DirichletEdge(Go::SplineCurve* sc = nullptr, int d = 0, int c = 0)
151  : curve(sc), dof(d), code(c) {}
152  };
153 
154 public:
157  {
158  protected:
159  const ASMs2D& myPatch;
160  public:
162  explicit InterfaceChecker(const ASMs2D& pch) : myPatch(pch) {}
164  virtual ~InterfaceChecker() {}
168  virtual short int hasContribution(int, int I, int J, int = -1) const;
169  };
170 
172  ASMs2D(unsigned char n_s = 2, unsigned char n_f = 2);
174  ASMs2D(const ASMs2D& patch, unsigned char n_f);
176  ASMs2D(const ASMs2D& patch);
178  virtual ~ASMs2D();
179 
182  virtual Go::SplineCurve* getBoundary(int dir, int = 1);
184  virtual Go::SplineSurface* getBasis(int basis = 1);
186  virtual const Go::SplineSurface* getBasis(int basis = 1) const;
188  virtual void copyParameterDomain(const ASMbase* other);
189 
190  // Methods for model generation
191  // ============================
192 
194  virtual bool read(std::istream&);
196  virtual bool write(std::ostream&, int) const;
197 
201  virtual bool generateFEMTopology();
202 
206  virtual void clear(bool retainGeometry = false);
207 
213  virtual bool addXElms(short int dim, short int item,
214  size_t nXn, IntVec& nodes);
215 
218  bool addInterfaceElms(const ASM::InterfaceChecker& iChk);
219 
224  virtual size_t getNodeIndex(int globalNum, bool noAddedNodes = false) const;
228  virtual int getNodeID(size_t inod, bool noAddedNodes = false) const;
229 
236  virtual bool getElementCoordinates(Matrix& X, int iel,
237  bool forceItg = false) const;
238 
243  virtual void getNodalCoordinates(Matrix& X, bool geo = false) const;
244 
247  virtual Vec3 getCoord(size_t inod) const;
248 
250  virtual Vec3 getElementCenter(int iel) const;
251 
254  virtual bool updateCoords(const Vector& displ);
255 
262  virtual void getBoundaryNodes(int lIndex, IntVec& nodes,
263  int basis, int thick = 1,
264  int = 0, bool local = false) const;
265 
270  virtual int getCorner(int I, int J, int basis) const;
271 
284  bool assignNodeNumbers(BlockNodes& nodes, int basis = 0);
285 
288  virtual bool checkRightHandSystem();
289 
294  virtual bool refine(int dir, const RealArray& xi, double scale = 1.0);
298  virtual bool uniformRefine(int dir, int nInsert);
302  virtual bool raiseOrder(int ru, int rv);
303 
305  virtual bool createProjectionBasis(bool init);
306 
308  virtual bool separateProjectionBasis() const;
309 
310 
311  // Various methods for preprocessing of boundary conditions and patch topology
312  // ===========================================================================
313 
320  virtual void constrainEdge(int dir, bool open, int dof, int code, char basis);
328  virtual size_t constrainEdgeLocal(int dir, bool open, int dof, int code,
329  bool project = false);
330 
341  virtual void constrainCorner(int I, int J, int dof,
342  int code = 0, char basis = 1);
354  virtual void constrainNode(double xi, double eta, int dof, int code = 0);
355 
363  virtual bool connectPatch(int edge, ASM2D& neighbor, int nedge, bool revers,
364  int = 0, bool coordCheck = true, int thick = 1);
365 
370  virtual void closeBoundaries(int dir, int basis, int master);
371 
375  virtual bool collapseEdge(int dir, int basis = 1);
376 
385  virtual bool addRigidCpl(int lindx, int ldim, int basis,
386  int& gMaster, const Vec3& Xmaster, bool extraPt);
387 
390  virtual void setNodeNumbers(const IntVec& nodes);
391 
397  virtual bool updateDirichlet(const std::map<int,RealFunc*>& func,
398  const std::map<int,VecFunc*>& vfunc, double time,
399  const std::map<int,int>* g2l = nullptr);
400 
401 
402  // Methods for integration of finite element quantities.
403  // These are the main computational methods of the ASM class hierarchy.
404  // ====================================================================
405 
410  virtual bool integrate(Integrand& integrand,
411  GlobalIntegral& glbInt, const TimeDomain& time);
412 
418  virtual bool integrate(Integrand& integrand, int lIndex,
419  GlobalIntegral& glbInt, const TimeDomain& time);
420 
426  virtual bool integrate(Integrand& integrand, GlobalIntegral& glbInt,
427  const TimeDomain& time, const ASM::InterfaceChecker& iChk);
428 
429 protected:
435  bool integrate(Integrand& integrand, GlobalIntegral& glbInt,
436  const TimeDomain& time, const Real3DMat& itgPts);
437 
438 public:
439 
440  // Post-processing methods
441  // =======================
442 
449  virtual int evalPoint(const double* xi, double* param, Vec3& X) const;
450 
454  virtual int findElementContaining(const double* param) const;
455 
460  virtual double findPoint(Vec3& X, double* param) const;
461 
466  virtual bool getGridParameters(RealArray& prm, int dir, int nSegSpan) const;
467 
472  virtual bool tesselate(ElementBlock& grid, const int* npe) const;
473 
480  virtual bool evalSolution(Matrix& sField, const Vector& locSol,
481  const int* npe, int n_f, bool piola) const;
482 
495  virtual bool evalSolution(Matrix& sField, const Vector& locSol,
496  const RealArray* gpar, bool regular = true,
497  int deriv = 0, int = 0) const;
498 
504  virtual bool evalProjSolution(Matrix& sField, const Vector& locSol,
505  const int* npe, int n_f) const;
506 
512  virtual bool evaluate(const ASMbase* basis, const Vector& locVec,
513  RealArray& vec, int basisNum) const;
514 
519  virtual bool evaluate(const Field* field, RealArray& vec, int basisNum) const;
520 
526  virtual bool evaluate(const FunctionBase* func, RealArray& vec,
527  int basisNum, double time) const;
528 
543  virtual bool evalSolution(Matrix& sField, const IntegrandBase& integrand,
544  const int* npe = nullptr, char project = 0) const;
545 
546 private:
549  Go::SplineSurface* projectSolution(const IntegrandBase& integrand) const;
550 
552  Go::SplineSurface* scRecovery(const IntegrandBase&) const;
553 
555  Go::SplineSurface* projectSolutionLocal(const IntegrandBase&) const;
556 
559  Go::SplineSurface* projectSolutionLocalApprox(const IntegrandBase&) const;
560 
562  Go::SplineSurface* projectSolutionLeastSquare(const IntegrandBase&) const;
563 
564 public:
567  virtual Go::GeomObject* evalSolution(const IntegrandBase& integrand) const;
568 
582  virtual bool evalSolution(Matrix& sField, const IntegrandBase& integrand,
583  const RealArray* gpar, bool regular = true) const;
584 
585 protected:
586 
587  // Internal utility methods
588  // ========================
589 
593  virtual void findBoundaryElms(IntVec& elms, int lIndex, int = 0) const;
594 
600  virtual bool assembleL2matrices(SystemMatrix& A, SystemVector& B,
601  const L2Integrand& integrand,
602  bool continuous) const;
603 
614  bool connectBasis(int edge, ASMs2D& neighbor, int nedge, bool revers,
615  int basis = 1, int slave = 0, int master = 0,
616  bool coordCheck = true, int thick = 1);
617 
623  void getGaussPointParameters(RealArray& uGP, int dir,
624  int nGauss, const double* xi) const;
625 
630  bool getGrevilleParameters(RealArray& prm, int dir, int basisNum = 1) const;
631 
635  bool getQuasiInterplParameters(RealArray& prm, int dir) const;
636 
639  double getParametricArea(int iel) const;
643  double getParametricLength(int iel, int dir) const;
644 
649  bool getElementCoordinatesPrm(Matrix& X, double u, double v) const;
650 
656  void getElementBorders(int i1, int i2, double* u, double* v) const;
660  virtual void getElementBorders(int iel, double* u) const;
661 
668  double getElementCorners(int i1, int i2, std::vector<Vec3>& XC,
669  RealArray* uC = nullptr) const;
674  void getCornerPoints(int i1, int i2, std::vector<utl::Point>& XC) const;
675 
681  virtual void generateThreadGroups(const Integrand& integrand, bool silence,
682  bool ignoreGlobalLM);
683 
685  virtual void changeNumThreads();
686 
692  void generateThreadGroups(size_t strip1, size_t strip2,
693  bool silence, bool ignoreGlobalLM);
694 
696  virtual void generateThreadGroupsFromElms(const IntVec& elms);
697 
699  virtual void generateProjThreadGroupsFromElms(const IntVec& elms);
700 
702  virtual bool validateThreadGroups(const SAM* sam) const;
703 
705  virtual int getFirstItgElmNode() const { return 0; }
707  virtual int getLastItgElmNode() const;
708 
709 public:
711  static void scatterInd(int n1, int n2, int p1, int p2,
712  const int* start, IntVec& index);
713 
714 private:
718  bool getOrder(int& p1, int& p2) const;
719 
720 public:
725  virtual bool getOrder(int& p1, int& p2, int& p3) const;
726 
731  virtual bool getSize(int& n1, int& n2, int basis = 0) const;
732 
738  virtual bool getSize(int& n1, int& n2, int& n3, int basis) const;
739 
744  virtual bool getNoStructElms(int& n1, int& n2, int& n3) const;
745 
749  virtual void getElmConnectivities(IntMat& neigh,
750  int basis = ASM::INTEGRATION_BASIS) const;
751 
753  virtual IntMat getElmNodes(int basis) const;
754 
756  virtual size_t getNoBoundaryElms(char lIndex, char ldim) const;
757 
759  virtual size_t getNoNodes(int basis = 0) const;
761  virtual size_t getNoProjectionNodes() const;
762 
766  virtual bool getParameterDomain(Real2DMat& u, IntVec* corners) const;
767 
772  virtual void evaluateBasis(double u, double v, double, Vector& N) const;
773 
780  void extractBasis(double u, double v, Vector& N, Matrix& dNdu,
781  bool fromRight = true) const;
789  void extractBasis(double u, double v, Vector& N,
790  Matrix& dNdu, Matrix3D& d2Ndu2,
791  bool fromRight = true) const;
799  void extractBasis(double u, double v, int dir, int p, Vector& dN,
800  bool fromRight = true) const;
801 
804  virtual Field* getProjectedField(const Vector& coefs) const;
805 
808  virtual Fields* getProjectedFields(const Vector& coefs, size_t = 0) const;
809 
810 private:
813  int coeffInd(size_t inod) const;
814 
816  static void createMNPC(const Go::SplineSurface* srf, IntMat& MNPC);
817 
818 protected:
819  std::shared_ptr<Go::SplineSurface> surf;
820  Go::SplineCurve* bou[4];
821  bool swapV;
822 
823  const IndexVec& nodeInd;
825 
826  std::map<size_t,size_t> xnMap;
827  std::map<size_t,size_t> nxMap;
828 
830  std::vector<DirichletEdge> dirich;
831 
834 
836  std::vector<std::unique_ptr<BasisFunctionCache>> myCache;
837 };
838 
839 #endif
Abstract interface for 2D patches.
std::vector< int > IntVec
General integer vector.
Definition: ASMbase.h:25
std::vector< IntVec > IntMat
General 2D integer matrix.
Definition: ASMbase.h:26
Base class for structured spline-based FE assembly drivers.
Basis function cache.
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
std::vector< Real2DMat > Real3DMat
A real-valued three-dimensional array without algebraic operations.
Definition: ImmersedBoundaries.h:36
Representation of domain interfaces.
Threading group partitioning.
Abstract interface for 2D spline patches.
Definition: ASM2D.h:33
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
const IntMat & MNPC
Matrix of Nodal Point Correspondance.
Definition: ASMbase.h:1040
int nGauss
Numerical integration scheme for this patch.
Definition: ASMbase.h:1064
virtual void generateThreadGroups(const Integrand &, bool, bool)
Generates element groups for multi-threading of interior integrals.
Definition: ASMbase.h:516
Implementation of basis function cache.
Definition: ASMs2D.h:64
const std::array< size_t, 2 > & noElms() const
Returns number of elements in each direction.
Definition: ASMs2D.h:79
bool internalInit() override
Implementation specific initialization.
Definition: ASMs2D.C:3448
bool setupQuadrature()
Configure quadratures.
Definition: ASMs2D.C:3461
void calculateAll() override
Calculates basis function info in all integration points.
Definition: ASMs2D.C:3553
const ASMs2D & patch
Reference to patch cache is for.
Definition: ASMs2D.h:106
std::array< size_t, 2 > nel
Number of elements in each direction.
Definition: ASMs2D.h:108
std::array< size_t, 2 > elmIndex(size_t el) const
Obtain structured element indices.
Definition: ASMs2D.C:3547
BasisFunctionVals calculatePt(size_t el, size_t gp, bool reduced) const override
Calculates basis function info in a single integration point.
Definition: ASMs2D.C:3504
size_t index(size_t el, size_t gp, bool reduced) const override
Obtain global integration point index.
Definition: ASMs2D.C:3536
virtual ~BasisFunctionCache()=default
Empty destructor.
virtual void setupParameters()
Setup integration point parameters.
Definition: ASMs2D.C:3493
Base class that checks if an element has interface contributions.
Definition: ASMs2D.h:157
virtual short int hasContribution(int, int I, int J, int=-1) const
Returns non-zero if the specified element have contributions.
Definition: ASMs2D.C:3167
virtual ~InterfaceChecker()
Empty destructor.
Definition: ASMs2D.h:164
const ASMs2D & myPatch
Reference to the patch being integrated.
Definition: ASMs2D.h:159
InterfaceChecker(const ASMs2D &pch)
The constructor initialises the reference to current patch.
Definition: ASMs2D.h:162
Driver for assembly of structured 2D spline FE models.
Definition: ASMs2D.h:39
ASMs2D(unsigned char n_s=2, unsigned char n_f=2)
Default constructor.
Definition: ASMs2D.C:46
virtual bool checkRightHandSystem()
Checks that the patch is modelled in a right-hand-side system.
Definition: ASMs2D.C:369
virtual bool createProjectionBasis(bool init)
Creates a separate projection basis for this patch.
Definition: ASMs2D.C:477
virtual int findElementContaining(const double *param) const
Returns the element that contains a specified spatial point.
Definition: ASMs2D.C:2556
bool getElementCoordinatesPrm(Matrix &X, double u, double v) const
Returns a matrix with nodal coordinates for element containing given parameters.
Definition: ASMs2D.C:1390
virtual double findPoint(Vec3 &X, double *param) const
Searches for the specified Cartesian point in the patch.
Definition: ASMs2D.C:2569
ThreadGroups threadGroups
Element groups for multi-threaded assembly.
Definition: ASMs2D.h:833
void getElementBorders(int i1, int i2, double *u, double *v) const
Computes the element border parameters.
Definition: ASMs2D.C:1621
virtual int getLastItgElmNode() const
Returns 0-based index of last node on integration basis.
Definition: ASMs2D.C:3421
virtual bool getNoStructElms(int &n1, int &n2, int &n3) const
Returns the number of elements in each parameter direction.
Definition: ASMs2D.C:3119
virtual bool separateProjectionBasis() const
Checks if a separate projection basis is used for this patch.
Definition: ASMs2D.C:459
virtual void findBoundaryElms(IntVec &elms, int lIndex, int=0) const
Finds the patch-local element numbers on a patch boundary.
Definition: ASMs2D.C:3324
virtual bool addRigidCpl(int lindx, int ldim, int basis, int &gMaster, const Vec3 &Xmaster, bool extraPt)
Adds MPCs representing a rigid coupling to this patch.
Definition: ASMs2D.C:3409
virtual bool getGridParameters(RealArray &prm, int dir, int nSegSpan) const
Calculates parameter values for visualization nodal points.
Definition: ASMs2D.C:2583
virtual bool assembleL2matrices(SystemMatrix &A, SystemVector &B, const L2Integrand &integrand, bool continuous) const
Assembles L2-projection matrices for the secondary solution.
Definition: ASMs2Drecovery.C:157
static void scatterInd(int n1, int n2, int p1, int p2, const int *start, IntVec &index)
Auxilliary function for computation of basis function indices.
Definition: ASMs2D.C:2667
virtual bool read(std::istream &)
Creates an instance by reading the given input stream.
Definition: ASMs2D.C:139
bool swapV
Has the v-parameter direction been swapped?
Definition: ASMs2D.h:821
std::shared_ptr< Go::SplineSurface > surf
The actual spline surface object.
Definition: ASMs2D.h:819
virtual void closeBoundaries(int dir, int basis, int master)
Makes two opposite boundary edges periodic.
Definition: ASMs2D.C:741
virtual ~ASMs2D()
The destructor frees the dynamically allocated boundary curves.
Definition: ASMs2D.C:85
virtual int evalPoint(const double *xi, double *param, Vec3 &X) const
Evaluates the geometry at a specified point.
Definition: ASMs2D.C:2541
int coeffInd(size_t inod) const
Returns an index into the internal coefficient array for a node.
Definition: ASMs2D.C:1312
Go::SplineSurface * projectSolutionLocal(const IntegrandBase &) const
Projects the secondary solution using Quasi-Interpolation.
Definition: ASMs2Drecovery.C:558
std::map< size_t, size_t > nxMap
Node index map used by getNodeID()
Definition: ASMs2D.h:827
virtual bool getElementCoordinates(Matrix &X, int iel, bool forceItg=false) const
Returns a matrix with nodal coordinates for an element.
Definition: ASMs2D.C:1350
virtual void getBoundaryNodes(int lIndex, IntVec &nodes, int basis, int thick=1, int=0, bool local=false) const
Finds the global (or patch-local) node numbers on a patch boundary.
Definition: ASMs2D.C:1475
virtual int getCorner(int I, int J, int basis) const
Returns the node index for a given corner.
Definition: ASMs2D.C:3204
Go::SplineSurface * projectSolutionLeastSquare(const IntegrandBase &) const
Projects the secondary solution using Least-Square Approximation.
Definition: ASMs2Drecovery.C:506
virtual bool tesselate(ElementBlock &grid, const int *npe) const
Creates a quad element model of this patch for visualization.
Definition: ASMs2D.C:2619
void extractBasis(double u, double v, Vector &N, Matrix &dNdu, bool fromRight=true) const
Establishes matrices with basis functions and 1st derivatives.
Definition: ASMs2D.C:3137
void getCornerPoints(int i1, int i2, std::vector< utl::Point > &XC) const
Computes the element corner coordinates and parameters.
Definition: ASMs2D.C:1670
const IndexVec & nodeInd
IJ-pairs for the control points (nodes)
Definition: ASMs2D.h:823
virtual void generateProjThreadGroupsFromElms(const IntVec &elms)
Generate element groups from a partition.
Definition: ASMs2D.C:3361
bool getQuasiInterplParameters(RealArray &prm, int dir) const
Calculates parameter values for the Quasi-Interpolation points.
Definition: ASMs2Drecovery.C:45
virtual void setNodeNumbers(const IntVec &nodes)
Sets the global node numbers for this patch.
Definition: ASMs2D.C:1163
virtual bool collapseEdge(int dir, int basis=1)
Collapses a degenereated edge into a single node.
Definition: ASMs2D.C:766
virtual void clear(bool retainGeometry=false)
Clears the contents of the patch, making it empty.
Definition: ASMs2D.C:196
double getParametricArea(int iel) const
Returns the area in the parameter space for an element.
Definition: ASMs2D.C:1247
Go::SplineSurface * scRecovery(const IntegrandBase &) const
Projects the secondary solution using a superconvergent approach.
Definition: ASMs2Drecovery.C:312
void getGaussPointParameters(RealArray &uGP, int dir, int nGauss, const double *xi) const
Extracts parameter values of the Gauss points in one direction.
Definition: ASMs2D.C:1602
virtual bool integrate(Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)
Evaluates an integral over the interior patch domain.
Definition: ASMs2D.C:1696
virtual bool evaluate(const ASMbase *basis, const Vector &locVec, RealArray &vec, int basisNum) const
Evaluates and interpolates a field over a given geometry.
Definition: ASMs2Drecovery.C:66
virtual void copyParameterDomain(const ASMbase *other)
Copies the parameter domain from the other patch.
Definition: ASMs2D.C:129
std::map< size_t, size_t > xnMap
Node index map used by getCoord()
Definition: ASMs2D.h:826
virtual int getFirstItgElmNode() const
Returns 0-based index of first node on integration basis.
Definition: ASMs2D.h:705
bool connectBasis(int edge, ASMs2D &neighbor, int nedge, bool revers, int basis=1, int slave=0, int master=0, bool coordCheck=true, int thick=1)
Connects all matching nodes on two adjacent boundary edges.
Definition: ASMs2D.C:686
virtual void changeNumThreads()
Hook for changing number of threads.
Definition: ASMs2D.C:3112
virtual IntMat getElmNodes(int basis) const
Returns the matrix of nodal point correspondance for given basis.
Definition: ASMs2D.C:3294
virtual size_t getNoProjectionNodes() const
Returns the number of projection nodes for this patch.
Definition: ASMs2D.C:3251
virtual size_t constrainEdgeLocal(int dir, bool open, int dof, int code, bool project=false)
Constrains all DOFs in local directions on a given boundary edge.
Definition: ASMs2D.C:920
virtual void constrainNode(double xi, double eta, int dof, int code=0)
Constrains a node identified by two relative parameter values.
Definition: ASMs2D.C:1145
virtual bool updateDirichlet(const std::map< int, RealFunc * > &func, const std::map< int, VecFunc * > &vfunc, double time, const std::map< int, int > *g2l=nullptr)
Updates the time-dependent in-homogeneous Dirichlet coefficients.
Definition: ASMs2D.C:1184
virtual bool uniformRefine(int dir, int nInsert)
Refines the parametrization by inserting extra knots uniformly.
Definition: ASMs2D.C:420
IndexVec myNodeInd
The actual IJ-pair container.
Definition: ASMs2D.h:824
virtual void constrainEdge(int dir, bool open, int dof, int code, char basis)
Constrains all DOFs on a given boundary edge.
Definition: ASMs2D.C:829
virtual void constrainCorner(int I, int J, int dof, int code=0, char basis=1)
Constrains a corner node identified by the two parameter indices.
Definition: ASMs2D.C:1111
virtual void generateThreadGroupsFromElms(const IntVec &elms)
Generates element groups from a partition.
Definition: ASMs2D.C:3346
virtual size_t getNodeIndex(int globalNum, bool noAddedNodes=false) const
Returns local 1-based index of the node with given global number.
Definition: ASMs2D.C:331
virtual bool connectPatch(int edge, ASM2D &neighbor, int nedge, bool revers, int=0, bool coordCheck=true, int thick=1)
Connects all matching nodes on two adjacent boundary edges.
Definition: ASMs2D.C:665
virtual bool validateThreadGroups(const SAM *sam) const
Validates the threading groups based on the assembly data in SAM.
Definition: ASMs2D.C:3367
virtual Vec3 getCoord(size_t inod) const
Returns the global coordinates for the given node.
Definition: ASMs2D.C:1329
virtual Field * getProjectedField(const Vector &coefs) const
Returns a field using the projection basis.
Definition: ASMs2D.C:3223
double getElementCorners(int i1, int i2, std::vector< Vec3 > &XC, RealArray *uC=nullptr) const
Computes the element corner coordinates.
Definition: ASMs2D.C:1633
virtual bool addXElms(short int dim, short int item, size_t nXn, IntVec &nodes)
Adds extraordinary elements associated with a patch boundary.
Definition: ASMs2D.C:220
virtual bool raiseOrder(int ru, int rv)
Raises the order of the SplineSurface object for this patch.
Definition: ASMs2D.C:449
std::vector< std::unique_ptr< BasisFunctionCache > > myCache
Basis function cache.
Definition: ASMs2D.h:836
virtual bool write(std::ostream &, int) const
Writes the geometry of the SplineSurface object to given stream.
Definition: ASMs2D.C:183
bool assignNodeNumbers(BlockNodes &nodes, int basis=0)
Assigns new global node numbers for all nodes of the patch.
Definition: ASMs2D.C:595
virtual bool getParameterDomain(Real2DMat &u, IntVec *corners) const
Returns parameter values and node numbers of the domain corners.
Definition: ASMs2D.C:1580
Go::SplineCurve * bou[4]
Pointers to the four boundary curves.
Definition: ASMs2D.h:820
virtual bool evalProjSolution(Matrix &sField, const Vector &locSol, const int *npe, int n_f) const
Evaluates the projected solution field at all visualization points.
Definition: ASMs2D.C:2797
Go::SplineSurface * projectSolution(const IntegrandBase &integrand) const
Projects the secondary solution field onto the primary basis.
Definition: ASMs2Drecovery.C:112
virtual bool generateFEMTopology()
Generates the finite element topology data for the patch.
Definition: ASMs2D.C:490
std::vector< IJ > IndexVec
Node index container.
Definition: ASMs2D.h:47
virtual void evaluateBasis(double u, double v, double, Vector &N) const
Evaluates the basis functions at the specified point.
Definition: ASMs2D.C:3129
bool addInterfaceElms(const ASM::InterfaceChecker &iChk)
Adds interface elements with coupling to all element DOFs.
Definition: ASMs2D.C:286
virtual void getNodalCoordinates(Matrix &X, bool geo=false) const
Returns a matrix with all nodal coordinates within the patch.
Definition: ASMs2D.C:1427
virtual void generateThreadGroups(const Integrand &, bool, bool)
Generates element groups for multi-threading of interior integrals.
Definition: ASMbase.h:516
std::vector< DirichletEdge > dirich
Inhomogeneous Dirichlet boundary condition data.
Definition: ASMs2D.h:830
Go::SplineSurface * projectSolutionLocalApprox(const IntegrandBase &) const
Projects the secondary solution using Variation Diminishing Spline Approximation.
Definition: ASMs2Drecovery.C:587
virtual size_t getNoNodes(int basis=0) const
Returns the total number of nodes in this patch.
Definition: ASMs2D.C:359
virtual bool refine(int dir, const RealArray &xi, double scale=1.0)
Refines the parametrization by inserting extra knots.
Definition: ASMs2D.C:389
static void createMNPC(const Go::SplineSurface *srf, IntMat &MNPC)
Creates matrix of nodal point correspondance for a spline surface.
Definition: ASMs2D.C:3302
bool getGrevilleParameters(RealArray &prm, int dir, int basisNum=1) const
Calculates parameter values for the Greville points.
Definition: ASMs2Drecovery.C:31
double getParametricLength(int iel, int dir) const
Returns boundary edge length in the parameter space for an element.
Definition: ASMs2D.C:1277
virtual Go::SplineCurve * getBoundary(int dir, int=1)
Returns the spline curve representing a boundary of this patch.
Definition: ASMs2D.C:93
std::pair< int, int > Ipair
Convenience type.
Definition: ASMs2D.h:139
virtual size_t getNoBoundaryElms(char lIndex, char ldim) const
Returns the number of elements on a boundary.
Definition: ASMs2D.C:1561
bool getOrder(int &p1, int &p2) const
Returns the polynomial order in each parameter direction.
Definition: ASMs2D.C:1521
virtual Go::SplineSurface * getBasis(int basis=1)
Returns the spline surface representing a basis of this patch.
Definition: ASMs2D.C:123
virtual Fields * getProjectedFields(const Vector &coefs, size_t=0) const
Returns a field using the projection basis.
Definition: ASMs2D.C:3235
virtual void getElmConnectivities(IntMat &neigh, int basis=ASM::INTEGRATION_BASIS) const
Calculates the matrix of element neighbour connectivities.
Definition: ASMs2D.C:3261
virtual int getNodeID(size_t inod, bool noAddedNodes=false) const
Returns the global node number for the given node.
Definition: ASMs2D.C:344
virtual bool updateCoords(const Vector &displ)
Updates the nodal coordinates for this patch.
Definition: ASMs2D.C:1446
virtual Vec3 getElementCenter(int iel) const
Returns the coordinate of the element center.
Definition: ASMs2D.C:1467
virtual bool getSize(int &n1, int &n2, int basis=0) const
Returns the number of nodal points in each parameter direction.
Definition: ASMs2D.C:1548
Base class for structured spline-based FE assembly drivers.
Definition: ASMstruct.h:32
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
BasisFunctionCache()
Default constructor.
Definition: BasisFunctionCache.C:22
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
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
Class containing threading group partitioning.
Definition: ThreadGroups.h:26
Simple class for representing a point in 3D space.
Definition: Vec3.h:27
A vector class with some added algebraic operations.
Definition: matrix.h:64
@ 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
General utility classes and functions.
Definition: SIMoptions.h:22
Struct with data for definition of global node numbers of a patch.
Definition: ASMs2D.h:119
Edge edges[4]
Edge nodes.
Definition: ASMs2D.h:121
int iinod
Global node number of the first interior node.
Definition: ASMs2D.h:122
int ibnod[4]
Vertex nodes.
Definition: ASMs2D.h:120
int inc[2]
Increment in global node numbering in each direction.
Definition: ASMs2D.h:123
int indxI
Running node index in the local I-direction.
Definition: ASMs2D.h:125
BlockNodes()
Default constructor.
Definition: ASMs2D.h:128
int nnodI
Number of nodes in parameter direction I.
Definition: ASMs2D.h:124
int next()
Returns iinod which then is incremented.
Definition: ASMs2D.C:580
Struct representing an inhomogeneous Dirichlet boundary condition.
Definition: ASMs2D.h:143
std::vector< Ipair > nodes
Nodes subjected to projection on the boundary.
Definition: ASMs2D.h:147
int dof
Local DOF to constrain along the boundary.
Definition: ASMs2D.h:145
int code
Inhomogeneous Dirichlet condition code.
Definition: ASMs2D.h:146
Go::SplineCurve * curve
Pointer to spline curve for the boundary.
Definition: ASMs2D.h:144
DirichletEdge(Go::SplineCurve *sc=nullptr, int d=0, int c=0)
Default constructor.
Definition: ASMs2D.h:150
Struct for edge node definitions.
Definition: ASMs2D.h:51
int next()
Returns icnod which then is incremented.
Definition: ASMs2D.C:571
int incr
Increment in the global numbering along the edge.
Definition: ASMs2D.h:53
int icnod
Global node number of first interior point along the edge.
Definition: ASMs2D.h:52
Edge()
Default constructor.
Definition: ASMs2D.h:56
Struct for nodal point data.
Definition: ASMs2D.h:42
int I
Index in first parameter direction.
Definition: ASMs2D.h:43
int J
Index in second parameter direction.
Definition: ASMs2D.h:44
Struct holding basis function values and derivatives.
Definition: BasisFunctionVals.h:25
Struct representing the time domain.
Definition: TimeDomain.h:23