34 void Foam::geomDecomp::setOrder()
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" 70 void 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);
137 if (n_[dir] > 1 && meshDirs[dir] == -1)
140 <<
"Trying to decompose a 1/2D mesh" 141 <<
" into " << n_[dir]
142 <<
" parts in direction " 154 decompositionMethod(divisions.
x()*divisions.
y()*divisions.z()),
165 const word& derivedType,
175 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs",
select))
183 const word& derivedType,
194 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs",
select))
Base class for coordinate system specification, the default coordinate system type is cartesian ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool equal(const T &a, const T &b)
Compare two values for equality.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
An user-specified coordinateRotation, primarily to be used internally within coding when the rotation...
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Vector< direction > order_
Decomposition order in terms of components (optional)
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
vectorField pointField
pointField is a vectorField.
A class for handling words, derived from Foam::string.
Abstract base class for domain decomposition.
tmp< pointField > adjustPoints(const pointField &) const
Apply delta (jitter) or rotation to coordinates.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
geomDecomp(const Vector< label > &divisions)
Construct with number of x/y/z division (no coefficients or constraints)
const dictionary & decompDict_
Top-level decomposition dictionary (eg, decomposeParDict)
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
const dictionary & coeffsDict_
Coefficients for all derived methods.
A class for managing temporary objects.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...