34void 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"
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_
87 const dictionary* transformDict =
92 csys_ = coordinateSystem(*transformDict);
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
115 csys_ = coordinateSystem(coordinateRotations::specified(rot));
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 "
154 const word& derivedType,
164 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs", select))
172 const word& derivedType,
183 coeffsDict_(findCoeffsDict(derivedType +
"Coeffs", select))
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Abstract base class for domain decomposition.
const dictionary & decompDict_
Top-level decomposition dictionary (eg, decomposeParDict)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Base for geometrical domain decomposition methods.
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.
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Foam::word regionName(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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)