12#ifndef MFEM_MESH_EXTRAS
13#define MFEM_MESH_EXTRAS
60 MFEM_VERIFY((A.
Height() == dim_ && A.
Width() == dim_) ||
62 "Affine transformation given an invalid matrix");
63 MFEM_VERIFY(
b.Size() == dim_ ||
b.Size() == 0,
64 "Affine transformation given an invalid vector");
93 real_t epsz_ = 0.3,
int smooth_ = 1)
95 epsz(epsz_), smooth(smooth_)
97 MFEM_VERIFY(
dim > 1,
"Kershaw transformation only works for 2D and 3D"
99 MFEM_VERIFY(smooth >= 1 && smooth <= 3,
100 "Kershaw parameter smooth must be in [1, 3]");
101 MFEM_VERIFY(epsy > 0 && epsy <=1,
102 "Kershaw parameter epsy must be in (0, 1].");
105 MFEM_VERIFY(epsz > 0 && epsz <=1,
106 "Kershaw parameter epsz must be in (0, 1].");
113 return (x <= 0.5) ? (2-eps) * x : 1 + eps*(x-1);
119 return 1-
right(eps,1-x);
126 if (x <= 0) {
return a; }
127 if (x >= 1) {
return b; }
128 if (smooth == 1) {
return a + (
b-
a) * (x); }
129 else if (smooth == 2) {
return a + (
b-
a) * (x*x*(3-2*x)); }
130 else {
return a + (
b-
a) * (x*x*x*(x*(6*x-15)+10)); }
150 real_t dim, turns, width, gap, height;
156 turns(turns_), width(width_), gap(gap_), height(height_)
158 MFEM_VERIFY(turns > 0 && width > 0 && gap > 0 && height > 0,
159 "Spiral transformation requires positive parameters: turns, "
160 " width, gap, and height.");
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.