IFEM  90A354
ASMu2DLag.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _ASM_U2D_LAG_H
15 #define _ASM_U2D_LAG_H
16 
17 #include "ASMs2DLag.h"
18 #include "ASMutils.h"
19 
20 
28 class ASMu2DLag : public ASMs2DLag
29 {
32  {
33  public:
37  : ASMs2DLag::BasisFunctionCache(pch) {}
38 
40  virtual ~BasisFunctionCache() = default;
41 
43  double getParam(int, size_t, size_t, bool) const override { return 0.0; }
44 
45  protected:
47  void setupParameters() override {}
48  };
49 
50 public:
52  ASMu2DLag(unsigned char n = 2, unsigned char n_f = 2, char fType = 'm');
54  ASMu2DLag(const ASMu2DLag& pch, unsigned char n_f);
56  ASMu2DLag(const ASMu2DLag& pch);
58  virtual ~ASMu2DLag() {}
59 
60  // Methods for model generation
61  // ============================
62 
64  virtual bool read(std::istream& is);
66  virtual bool generateFEMTopology();
68  virtual bool empty() const { return nel == 0; }
69 
71  virtual int getNodeSetIdx(const std::string& setName) const;
73  virtual const IntVec& getNodeSet(int iset) const;
75  virtual bool isInNodeSet(int iset, int inod) const;
77  virtual int parseNodeSet(const std::string& setName, const char* cset);
79  virtual int parseNodeBox(const std::string& setName, const char* bbox);
86  int addToNodeSet(const std::string& setName, int inod, bool extId = false);
88  bool getNodeSet(int iset, std::string& name) const;
89 
91  virtual int getElementSetIdx(const std::string& setName) const;
93  virtual const IntVec& getElementSet(int iset) const;
95  virtual bool getElementSet(int iset, std::string& name) const;
97  virtual bool isInElementSet(int iset, int iel) const;
99  virtual int parseElemSet(const std::string& setName, const char* cset);
101  virtual int parseElemBox(const std::string& setName,
102  const std::string& unionSet, const char* bbox);
109  int addToElemSet(const std::string& setName, int iel, bool extId = false);
110 
115  virtual void getBoundaryNodes(int lIndex, IntVec& nodes,
116  int, int, int, bool local) const;
117 
118  using ASMs2DLag::integrate;
123  virtual bool integrate(Integrand& integrand,
124  GlobalIntegral& glbInt, const TimeDomain& time);
125 
128  virtual void generateThreadGroups(const Integrand&, bool silence,
129  bool separateGroup1noded);
130 
131  // Post-processing methods
132  // =======================
133 
137  virtual bool tesselate(ElementBlock& grid, const int*) const;
138 
140  bool writeXML(const char* fname) const;
141 
142 protected:
151  virtual bool evalSolPt(int iel, double xi, double eta,
152  size_t nCmp, const Vector& pchSol,
153  RealArray& ptSol, RealArray& N) const;
154 
156  void generateThreadGroupsMultiColored(bool silence, bool separateGroup1Noded);
157 
158  bool swapNode34;
159 
160  std::vector<ASM::NodeSet> nodeSets;
161  std::vector<ASM::NodeSet> elemSets;
162 
163 private:
164  char fileType;
165 };
166 
167 #endif
std::vector< int > IntVec
General integer vector.
Definition: ASMbase.h:25
Driver for assembly of structured 2D Lagrange FE models.
Various utilities for assembly scope.
std::vector< Real > RealArray
A real-valued array without algebraic operations.
Definition: ImmersedBoundaries.h:29
size_t nel
Number of regular elements in this patch.
Definition: ASMbase.h:1035
Implementation of basis function cache.
Definition: ASMs2DLag.h:31
Driver for assembly of structured 2D Lagrange FE models.
Definition: ASMs2DLag.h:27
virtual void generateThreadGroups(const Integrand &integrand, bool silence, bool ignoreGlobalLM)
Generates element groups for multi-threading of interior integrals.
Definition: ASMs2D.C:3021
virtual bool integrate(Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)
Evaluates an integral over the interior patch domain.
Definition: ASMs2DLag.C:468
Implementation of basis function cache.
Definition: ASMu2DLag.h:32
double getParam(int, size_t, size_t, bool) const override
No integration point parameters for unstructured patches.
Definition: ASMu2DLag.h:43
virtual ~BasisFunctionCache()=default
Empty destructor.
BasisFunctionCache(const ASMu2DLag &pch)
The constructor forwards to the parent class constructor.
Definition: ASMu2DLag.h:36
void setupParameters() override
No integration point parameters for unstructured patches.
Definition: ASMu2DLag.h:47
Driver for assembly of unstructured 2D Lagrange FE models.
Definition: ASMu2DLag.h:29
bool writeXML(const char *fname) const
Dumps the mesh to the specified XML-file.
Definition: ASMu2DLag.C:642
virtual bool evalSolPt(int iel, double xi, double eta, size_t nCmp, const Vector &pchSol, RealArray &ptSol, RealArray &N) const
Evaluates a nodal solution field at specified point in an element.
Definition: ASMu2DLag.C:622
virtual int parseNodeBox(const std::string &setName, const char *bbox)
Defines a node set by parsing a 3D bounding box.
Definition: ASMu2DLag.C:195
int addToNodeSet(const std::string &setName, int inod, bool extId=false)
Adds a node to a named node set.
Definition: ASMu2DLag.C:239
virtual const IntVec & getElementSet(int iset) const
Returns an indexed predefined element set.
Definition: ASMu2DLag.C:278
virtual int parseElemBox(const std::string &setName, const std::string &unionSet, const char *bbox)
Defines an element set by parsing a 3D bounding box.
Definition: ASMu2DLag.C:354
virtual int parseElemSet(const std::string &setName, const char *cset)
Defines an element set by parsing a list of element numbers.
Definition: ASMu2DLag.C:316
int addToElemSet(const std::string &setName, int iel, bool extId=false)
Adds an element to a named element set.
Definition: ASMu2DLag.C:406
virtual bool empty() const
Checks if this patch is empty.
Definition: ASMu2DLag.h:68
virtual int getElementSetIdx(const std::string &setName) const
Returns (1-based) index of a predefined element set in the patch.
Definition: ASMu2DLag.C:265
void generateThreadGroupsMultiColored(bool silence, bool separateGroup1Noded)
Generate thread groups using multi-coloring.
Definition: ASMu2DLag.C:454
virtual bool generateFEMTopology()
Generates the finite element topology data for the patch.
Definition: ASMu2DLag.C:72
virtual void getBoundaryNodes(int lIndex, IntVec &nodes, int, int, int, bool local) const
Finds the global (or patch-local) node numbers on a patch boundary.
Definition: ASMu2DLag.C:432
virtual bool isInElementSet(int iset, int iel) const
Checks if element iel is within predefined element set iset.
Definition: ASMu2DLag.C:304
virtual bool read(std::istream &is)
Creates an instance by reading the given input stream.
Definition: ASMu2DLag.C:55
std::vector< ASM::NodeSet > elemSets
Element sets for properties.
Definition: ASMu2DLag.h:161
virtual int getNodeSetIdx(const std::string &setName) const
Returns (1-based) index of a predefined node set in the patch.
Definition: ASMu2DLag.C:113
virtual void generateThreadGroups(const Integrand &, bool, bool)
Generates element groups for multi-threading of interior integrals.
Definition: ASMs2DLag.C:932
char fileType
Mesh file format.
Definition: ASMu2DLag.h:164
virtual bool integrate(Integrand &integrand, GlobalIntegral &glbInt, const TimeDomain &time)
Evaluates an integral over the interior patch domain.
Definition: ASMs2DLag.C:468
virtual int parseNodeSet(const std::string &setName, const char *cset)
Defines a node set by parsing a list of node numbers.
Definition: ASMu2DLag.C:164
ASMu2DLag(unsigned char n=2, unsigned char n_f=2, char fType='m')
Default constructor.
Definition: ASMu2DLag.C:31
virtual ~ASMu2DLag()
Empty destructor.
Definition: ASMu2DLag.h:58
virtual bool tesselate(ElementBlock &grid, const int *) const
Creates a quad element model of this patch for visualization.
Definition: ASMu2DLag.C:545
virtual bool isInNodeSet(int iset, int inod) const
Checks if node inod is within predefined node set iset.
Definition: ASMu2DLag.C:152
std::vector< ASM::NodeSet > nodeSets
Node sets for Dirichlet BCs.
Definition: ASMu2DLag.h:160
bool swapNode34
If true, element nodes 3 and 4 should be swapped.
Definition: ASMu2DLag.h:158
virtual const IntVec & getNodeSet(int iset) const
Returns an indexed predefined node set.
Definition: ASMu2DLag.C:126
Class for storage of a standard FE grid block.
Definition: ElementBlock.h:27
Abstract base class representing a system level integrated quantity.
Definition: GlobalIntegral.h:29
Abstract base class representing a system level integrated quantity.
Definition: Integrand.h:44
A vector class with some added algebraic operations.
Definition: matrix.h:64
Struct representing the time domain.
Definition: TimeDomain.h:23