24#ifndef HYPERPLANE_3D_HH
25#define HYPERPLANE_3D_HH
65 u = {normal[2], T(), -normal[0]};
82 origin[0] = o[0] - 2*std::numeric_limits<T>::epsilon()*
util::fabs(o[0]);
83 origin[1] = o[1] - 2*std::numeric_limits<T>::epsilon()*
util::fabs(o[1]);
84 origin[2] = o[2] - 2*std::numeric_limits<T>::epsilon()*
util::fabs(o[2]);
96 origin[0] = (cuboidOrigin[0] + 0.5 * deltaR * extend[0]);
97 origin[1] = (cuboidOrigin[1] + 0.5 * deltaR * extend[1]);
98 origin[2] = (cuboidOrigin[2] + 0.5 * deltaR * extend[2]);
99 origin[0] -= 2*std::numeric_limits<T>::epsilon()*
util::fabs(origin[0]);
100 origin[1] -= 2*std::numeric_limits<T>::epsilon()*
util::fabs(origin[1]);
101 origin[2] -= 2*std::numeric_limits<T>::epsilon()*
util::fabs(origin[2]);
112 const auto u_prime = u;
113 const auto v_prime = v;
115 u[0] = row0 * u_prime;
116 u[1] = row1 * u_prime;
117 u[2] = row2 * u_prime;
119 v[0] = row0 * v_prime;
120 v[1] = row1 * v_prime;
121 v[2] = row2 * v_prime;
129 return applyMatrixToSpan(
140 return applyMatrixToSpan(
150 return applyMatrixToSpan(
181 return origin + x[0]*u + x[1]*v;
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
Vector< T, 3 > getOrigin() const
Read only access to left lower corner coordinates.
Vector< int, 3 > const getExtent() const
Read only access to the number of voxels in every dimension.
T getDeltaR() const
Read only access to the distance of cuboid nodes.
ADf< T, DIM > sin(const ADf< T, DIM > &a)
cpu::simd::Pack< T > fabs(cpu::simd::Pack< T > value)
T dotProduct3D(const Vector< T, 3 > &a, const Vector< T, 3 > &b)
dot product, only valid in 3d
bool nearZero(const ADf< T, DIM > &a)
ADf< T, DIM > cos(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
constexpr Vector< T, 3 > crossProduct3D(const ScalarVector< T, 3, IMPL > &a, const ScalarVector< T, 3, IMPL_ > &b) any_platform
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
#define OLB_POSTCONDITION(COND)
Definition of a analytical 2D plane embedded in 3D space.
Vector< T, 3 > project(const Vector< T, 2 > &x) const
Hyperplane3D & centeredIn(const Cuboid3D< T > &cuboid)
Center the hyperplane relative to the given cuboid.
Hyperplane3D & rotateSpanAroundZ(T r)
Rotate the spanning vectors around the Z axis.
Hyperplane3D & spannedBy(const Vector< T, 3 > &u, const Vector< T, 3 > &v)
Span the hyperplane using two span vectors.
Hyperplane3D & rotateSpanAroundX(T r)
Rotate the spanning vectors around the X axis.
Hyperplane3D & rotateSpanAroundY(T r)
Rotate the spanning vectors around the Y axis.
Hyperplane3D & normalTo(const Vector< T, 3 > &normal)
Calculate the spanning vectors of the hyperplane to be orthogonal to the given normal.
Hyperplane3D & applyMatrixToSpan(const Vector< T, 3 > &row0, const Vector< T, 3 > &row1, const Vector< T, 3 > &row2)
Apply a matrix given by its row vectors to both span vectors.
Hyperplane3D & originAt(const Vector< T, 3 > &origin)
Center the hyperplane at the given origin vector.