67 else if (first() == 1)
69 vector planeNormal = cd ^ second();
70 scalar magPlaneNormal =
mag(planeNormal);
72 if (magPlaneNormal > 1
e-3)
75 second() = planeNormal/magPlaneNormal;
78 else if (first() == 2)
80 if (
mag(cd & second()) > 1
e-3)
95 else if (first() == 1)
103 else if (first() == 2)
107 else if (pc.first() == 1)
109 applyConstraint(pc.second());
111 else if (pc.first() == 2)
114 if (
mag(second() & pc.second()) <= (1.0-1
e-3))
136 else if (first() == 1)
138 return I -
sqr(second());
140 else if (first() == 2)
142 return sqr(second());
159 FixedList<vector, 3> vecs;
163 vecs[0] =
vector(1, 0, 0);
164 vecs[1] =
vector(0, 1, 0);
165 vecs[2] =
vector(0, 0, 1);
167 else if (first() == 1)
169 const vector& planeDir = second();
171 vecs[0] =
vector(1, 0, 0) - planeDir.x()*planeDir;
173 if (
mag(vecs[0].
x()) < 1
e-3)
175 vecs[0] =
vector(0, 1, 0) - planeDir.y()*planeDir;
178 vecs[0] /=
mag(vecs[0]);
179 vecs[1] = vecs[0] ^ planeDir;
180 vecs[1] /=
mag(vecs[1]);
182 else if (first() == 2)
188 for (
direction dir =
n; dir < vecs.size(); dir++)
193 tt =
tensor(vecs[0], vecs[1], vecs[2]);
208 else if (first() == 1)
211 cd = d-(d&second())*second();
213 else if (first() == 2)
216 cd = (d&second())*second();
A 1D vector of objects of type <T> with a fixed length <N>.
static constexpr label size() noexcept
Return the number of elements in the FixedList.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const label & first() const noexcept
const vector & second() const noexcept
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & y() const noexcept
Access to the vector y component.
Accumulates point constraints through successive applications of the applyConstraint function.
void combine(const pointConstraint &)
Combine constraints.
void applyConstraint(const vector &cd)
Apply and accumulate the effect of the given constraint direction.
pointConstraint()
Default construct zero-initialized.
tensor constraintTransformation() const
Return the accumulated constraint transformation tensor.
void unconstrainedDirections(label &n, tensor &vecs) const
Return the accumulated unconstrained directions. Directions coded as first n rows of tensor.
vector constrainDisplacement(const vector &disp) const
Constrain a displacement.
Tensor of scalars, i.e. Tensor<scalar>.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
static const Identity< scalar > I
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0).