12#ifndef MFEM_MESH_EXTRAS
13#define MFEM_MESH_EXTRAS
65 MFEM_VERIFY((A.
Height() == dim_ && A.
Width() == dim_) ||
67 "Affine transformation given an invalid matrix");
68 MFEM_VERIFY(
b.Size() == dim_ ||
b.Size() == 0,
69 "Affine transformation given an invalid vector");
98 real_t epsz_ = 0.3,
int smooth_ = 1)
100 epsz(epsz_), smooth(smooth_)
102 MFEM_VERIFY(
dim > 1,
"Kershaw transformation only works for 2D and 3D"
104 MFEM_VERIFY(smooth >= 1 && smooth <= 3,
105 "Kershaw parameter smooth must be in [1, 3]");
106 MFEM_VERIFY(epsy > 0 && epsy <=1,
107 "Kershaw parameter epsy must be in (0, 1].");
110 MFEM_VERIFY(epsz > 0 && epsz <=1,
111 "Kershaw parameter epsz must be in (0, 1].");
118 return (x <= 0.5) ? (2-eps) * x : 1 + eps*(x-1);
124 return 1-
right(eps,1-x);
131 if (x <= 0) {
return a; }
132 if (x >= 1) {
return b; }
133 if (smooth == 1) {
return a + (
b-
a) * (x); }
134 else if (smooth == 2) {
return a + (
b-
a) * (x*x*(3-2*x)); }
135 else {
return a + (
b-
a) * (x*x*x*(x*(6*x-15)+10)); }
155 real_t dim, turns, width, gap, height;
161 turns(turns_), width(width_), gap(gap_), height(height_)
163 MFEM_VERIFY(turns > 0 && width > 0 && gap > 0 && height > 0,
164 "Spiral transformation requires positive parameters: turns, "
165 " width, gap, and height.");
int Find(const T &el) const
Return the first index where 'el' is found; return -1 if not found.
static Array< int > AttrToMarker(int max_attr, const Array< int > &attrs)
Prepares a marker array corresponding to an array of element attributes.
Data type dense matrix using column-major storage.
Type
Constants for the classes derived from Element.
Class for integration point with weight.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
Base class for vector Coefficients that optionally depend on time and space.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
ElementMeshStream(Element::Type e)
void MergeMeshNodes(Mesh *mesh, int logging)
Merges vertices which lie at the same location.
void AttrToMarker(int max_attr, const Array< int > &attrs, Array< int > &marker)
Convert a set of attribute numbers to a marker array.