14#ifndef _ELEMENT_BLOCK_H
15#define _ELEMENT_BLOCK_H
38 void resize(
size_t nI,
size_t nJ = 1,
size_t nK = 1);
57 bool setNode(
size_t i,
int nodeNumb);
67 size_t addLine(
size_t i1,
const Vec3& X2,
int elmId = -1);
87 std::vector<int>& nodeNums,
bool uniqNodes =
true);
95 std::vector<Vec3>::const_iterator
begin_XYZ()
const {
return coord.begin(); }
97 std::vector<Vec3>::const_iterator
end_XYZ()
const {
return coord.end(); }
107 bool getElements(std::vector<int>& mnpc,
size_t nenod)
const;
115 using Prm3 = std::array<Real,3>;
177 SphereBlock(
const Vec3& X0,
double R,
size_t nTheta = 180,
size_t nPhi = 60);
196 double R,
size_t nTheta = 180);
#define Real
The floating point type to use.
Definition ImmersedBoundaries.h:18
Global algebraic operations on index 1-based matrices and vectors.
Representation of points in 3D space with coordinates and parameters.
Class for single-element cube geometries.
Definition ElementBlock.h:154
Class for cylinder geometries.
Definition ElementBlock.h:188
Class for storage of a standard FE grid block.
Definition ElementBlock.h:27
void resize(size_t nI, size_t nJ=1, size_t nK=1)
Reallocates the internal arrays to fit a structured grid.
Definition ElementBlock.C:43
bool setParams(size_t i, Real u, Real v, Real w=Real(0))
Defines the parameter values for node i.
Definition ElementBlock.C:104
std::vector< Vec3 >::const_iterator begin_XYZ() const
Returns the beginning of the coordinate array.
Definition ElementBlock.h:95
size_t getNoNodes() const
Returns the total number of nodes in the block.
Definition ElementBlock.h:77
const Real * getParam(size_t i) const
Returns a pointer to the parameter values of a given node.
Definition ElementBlock.C:233
bool setCoor(size_t i, size_t j, Real x)
Defines the j'th coordinate of node i.
Definition ElementBlock.C:86
size_t nen
Number of Element Nodes.
Definition ElementBlock.h:121
std::array< Real, 3 > Prm3
Convenience type.
Definition ElementBlock.h:115
size_t getNoElmNodes() const
Returns the number of nodes per element.
Definition ElementBlock.h:81
void transform(const Matrix &Tlg)
Applies a transformation matrix from local to global system.
Definition ElementBlock.C:225
int getElmId(size_t i) const
Returns the external ID of an element.
Definition ElementBlock.h:72
std::vector< Vec3 > coord
Vector of nodal coordinates.
Definition ElementBlock.h:117
std::vector< Prm3 > param
Vector of parameter values of the nodal points.
Definition ElementBlock.h:118
bool endOfElm(size_t &i)
Marks the end of current element for unstructured grids.
Definition ElementBlock.C:124
static double eps
Element shrinkage factor.
Definition ElementBlock.h:127
void unStructResize(size_t nEl, size_t nPts, size_t nMNPC=0)
Reallocates the internal arrays to fit an unstructured grid.
Definition ElementBlock.C:67
void removeElement(int iel)
Removes all elements with the specified external ID.
Definition ElementBlock.C:313
void setNoElmNodes(size_t nenod)
Sets the number of nodes per element.
Definition ElementBlock.h:83
const int * getElements() const
Returns a pointer to the element connectivity array.
Definition ElementBlock.h:105
bool setNode(size_t i, int nodeNumb)
Defines the global number of element node i.
Definition ElementBlock.C:115
std::vector< int > MINEX
Matrix of Internal to External element numbers.
Definition ElementBlock.h:120
void merge(const ElementBlock *other, std::vector< int > &nodeNums, bool uniqNodes=true)
Merges another element block into this one.
Definition ElementBlock.C:188
const Vec3 & getCoord(size_t i) const
Returns the coordinate of a given node.
Definition ElementBlock.h:100
virtual ~ElementBlock()=default
Empty destructor.
bool addLine(Real x1, Real y1, Real z1, Real x2, Real y2, Real z2)
Adds a line element to the grid, assuming nen is equal to two.
Definition ElementBlock.C:162
std::vector< Vec3 >::const_iterator end_XYZ() const
Returns the end of the coordinate array.
Definition ElementBlock.h:97
utl::Point getCenter(size_t i) const
Returns the coordinates of the center of the given element.
Definition ElementBlock.C:268
size_t getNoElms() const
Returns the total number of elements in the block.
Definition ElementBlock.h:79
void setElmId(size_t i, int iel)
Assigns an external ID to an element.
Definition ElementBlock.h:70
std::vector< size_t > elmIdx
Internal element order in case of mixed types.
Definition ElementBlock.h:124
bool setCoor(size_t i, Real x, Real y, Real z)
Defines the coordinates of node i.
Definition ElementBlock.h:51
std::vector< int > MMNPC
Matrix of Matrices of Nodal Point Correspondance.
Definition ElementBlock.h:119
size_t getElmIndex(size_t i) const
Returns the internal index of an element in case of mixed types.
Definition ElementBlock.h:74
Class for single-element plane geometries.
Definition ElementBlock.h:137
Class for sphere geometries.
Definition ElementBlock.h:170
Simple class for representing a point in 3D space.
Definition Vec3.h:27
Class for representing points in 3D space.
Definition Point.h:29