34void Foam::geomDecomp::setOrder()
36 const word order(
coeffsDict_.getOrDefault<word>(
"order",
""));
42 else if (order.size() != 3)
45 <<
"Number of characters in order (" << order <<
") != 3"
49 for (
int i = 0; i < 3; ++i)
55 case 'x':
order_[i] = 0;
break;
56 case 'y':
order_[i] = 1;
break;
57 case 'z':
order_[i] = 2;
break;
61 <<
"Illegal decomposition order " << order <<
nl
62 <<
"It should only contain x, y or z"
70void Foam::geomDecomp::readCoeffs()
72 coeffsDict_.readIfPresent(
"delta", delta_);
74 coeffsDict_.readEntry(
"n", n_);
76 if (nDomains_ != n_.x()*n_.y()*n_.z())
80 <<
"Wrong number of domain divisions in geomDecomp:" <<
nl
81 <<
"Number of domains : " << nDomains_ <<
nl
82 <<
"Wanted decomposition : " << n_
88 auto csysPtr = coordinateSystem::NewIfPresent(coeffsDict_,
"transform");
94 else if (
equal(delta_, 0))
100 const scalar d = 1 - 0.5*delta_*delta_;
101 const scalar d2 =
sqr(d);
103 const scalar a = delta_;
104 const scalar a2 =
sqr(a);
110 a*d - a2*d, a*a2 + d2, -2*a*d,
111 a*d2 + a2, a*d - a2*d, d2 - a2
126 return csys_.localPosition(
points);
135 for (
direction dir = 0; dir < Vector<label>::nComponents; ++dir)
137 if (n_[dir] > 1 && meshDirs[dir] == -1)
140 <<
"Trying to decompose a 1/2D mesh"
141 <<
" into " << n_[dir]
142 <<
" parts in direction "
165 const word& derivedType,
183 const word& derivedType,
194 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs", select))
static const char *const componentNames[]
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
An user-specified coordinateRotation, primarily to be used internally within coding when the rotation...
Base class for coordinate system specification, the default coordinate system type is cartesian .
Abstract base class for domain decomposition.
const dictionary & decompDict_
Top-level decomposition dictionary (eg, decomposeParDict).
decompositionMethod(const label numDomains)
Construct with specified number of domains, no coefficients or constraints.
static FOAM_NO_DANGLING_REFERENCE const dictionary & findCoeffsDict(const dictionary &dict, const word &coeffsName, int select=selectionType::DEFAULT)
Locate coeffsName dictionary or the fallback "coeffs" dictionary within an enclosing dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & coeffsDict_
Coefficients for all derived methods.
Vector< direction > order_
Decomposition order in terms of components (optional).
tmp< pointField > adjustPoints(const pointField &) const
Apply delta (jitter) or rotation to coordinates.
Vector< label > n_
The divisions.
geomDecomp(const Vector< label > &divisions)
Construct with number of x/y/z division (no coefficients or constraints).
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool equal(const T &a, const T &b)
Compare two values for equality.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).