OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::HyperplaneLattice3D< T > Class Template Reference

Parametrization of a hyperplane lattice. More...

#include <hyperplaneLattice3D.h>

+ Inheritance diagram for olb::HyperplaneLattice3D< T >:
+ Collaboration diagram for olb::HyperplaneLattice3D< T >:

Public Member Functions

 HyperplaneLattice3D (CuboidDecomposition< T, 3 > &geometry, Hyperplane3D< T > hyperplane)
 Constructor for automatic discretization.
 
 HyperplaneLattice3D (CuboidDecomposition< T, 3 > &geometry, Hyperplane3D< T > hyperplane, int resolution)
 Constructor for discretization of a given resolution.
 
 HyperplaneLattice3D (CuboidDecomposition< T, 3 > &geometry, Hyperplane3D< T > hyperplane, T h)
 Constructor for discretization of a given grid width.
 
 HyperplaneLattice3D (Hyperplane3D< T > hyperplane, T h, int nx, int ny)
 Constructor for manual discretization.
 
 HyperplaneLattice3D (const HyperplaneLattice3D &)=default
 
const Hyperplane3D< T > & getHyperplane () const
 
Vector< T, 3 > getPhysR (const int &planeX, const int &planeY) const
 Transform 2d lattice coordinates to their physical 3d location.
 
int getNx () const
 
int getNy () const
 
getPhysSpacing () const
 
Vector< T, 3 > getPhysOrigin () const
 
Vector< T, 3 > getVectorU () const
 
Vector< T, 3 > getVectorV () const
 

Protected Attributes

const Hyperplane3D< T > _hyperplane
 
Vector< T, 3 > _origin
 Origin vector of the lattice.
 
Vector< T, 3 > _u
 Span vector of the lattice, normalized to grid width _h.
 
Vector< T, 3 > _v
 Span vector of the lattice, normalized to grid width _h.
 
_h
 Distance between discrete lattice points.
 
int _nx
 Number of lattice points in the direction of _u.
 
int _ny
 Number of lattice points in the direction of _v.
 

Detailed Description

template<typename T>
class olb::HyperplaneLattice3D< T >

Parametrization of a hyperplane lattice.

i.e. the resolution / grid width of the discretization of a given hyperplane.

This class provides a common interface for describing how to discretize the intersection of a hyperplane given by Hyperplane3D<T> and the mother cuboid of CuboidDecomposition3D<T>.

Definition at line 41 of file hyperplaneLattice3D.h.

Constructor & Destructor Documentation

◆ HyperplaneLattice3D() [1/5]

template<typename T >
olb::HyperplaneLattice3D< T >::HyperplaneLattice3D ( CuboidDecomposition< T, 3 > & geometry,
Hyperplane3D< T > hyperplane )

Constructor for automatic discretization.

i.e. the grid width is set to CuboidDecomposition3D<T>::getDeltaR.

Definition at line 172 of file hyperplaneLattice3D.hh.

174 : _hyperplane(hyperplane),
175 _origin(hyperplane.origin),
176 _u(hyperplane.u),
177 _v(hyperplane.v),
178 _h(geometry.getDeltaR())
179{
180 _u = normalize(_u, _h);
181 _v = normalize(_v, _h);
182
183 const int maxLatticeDistance = computeMaxLatticeDistance(geometry.getMotherCuboid());
184 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
185 constructCuboid(geometry, maxLatticeDistance);
186}
Vector< T, 3 > _origin
Origin vector of the lattice.
Vector< T, 3 > _v
Span vector of the lattice, normalized to grid width _h.
Vector< T, 3 > _u
Span vector of the lattice, normalized to grid width _h.
const Hyperplane3D< T > _hyperplane
T _h
Distance between discrete lattice points.
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Definition vector.h:284

References olb::HyperplaneLattice3D< T >::_h, olb::HyperplaneLattice3D< T >::_u, olb::HyperplaneLattice3D< T >::_v, olb::CuboidDecomposition< T, D >::getMotherCuboid(), and olb::normalize().

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [2/5]

template<typename T >
olb::HyperplaneLattice3D< T >::HyperplaneLattice3D ( CuboidDecomposition< T, 3 > & geometry,
Hyperplane3D< T > hyperplane,
int resolution )

Constructor for discretization of a given resolution.

Definition at line 189 of file hyperplaneLattice3D.hh.

191 : _hyperplane(hyperplane),
192 _origin(hyperplane.origin),
193 _u(hyperplane.u),
194 _v(hyperplane.v),
195 _h(geometry.getDeltaR())
196{
197 _u = normalize(_u, _h);
198 _v = normalize(_v, _h);
199
200 const int maxLatticeDistance = computeMaxLatticeDistance(geometry.getMotherCuboid());
201 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
202 constructCuboid(geometry, maxLatticeDistance);
203
204 if ( resolution > 0 ) {
205 setToResolution(resolution);
206 }
207}

References olb::HyperplaneLattice3D< T >::_h, olb::HyperplaneLattice3D< T >::_u, olb::HyperplaneLattice3D< T >::_v, olb::CuboidDecomposition< T, D >::getMotherCuboid(), and olb::normalize().

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [3/5]

template<typename T >
olb::HyperplaneLattice3D< T >::HyperplaneLattice3D ( CuboidDecomposition< T, 3 > & geometry,
Hyperplane3D< T > hyperplane,
T h )

Constructor for discretization of a given grid width.

Definition at line 210 of file hyperplaneLattice3D.hh.

212 : _hyperplane(hyperplane),
213 _origin(hyperplane.origin),
214 _u(hyperplane.u),
215 _v(hyperplane.v),
216 _h(h)
217{
218 if ( util::nearZero(_h) ) {
219 _h = geometry.getDeltaR();
220 }
221
222 _u = normalize(_u, _h);
223 _v = normalize(_v, _h);
224
225 const int maxLatticeDistance = computeMaxLatticeDistance(geometry.getMotherCuboid());
226 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
227 constructCuboid(geometry, maxLatticeDistance);
228}
bool nearZero(T a) any_platform
return true if a is close to zero
Definition util.h:402

References olb::HyperplaneLattice3D< T >::_h, olb::HyperplaneLattice3D< T >::_u, olb::HyperplaneLattice3D< T >::_v, olb::CuboidDecomposition< T, D >::getDeltaR(), olb::CuboidDecomposition< T, D >::getMotherCuboid(), olb::util::nearZero(), and olb::normalize().

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [4/5]

template<typename T >
olb::HyperplaneLattice3D< T >::HyperplaneLattice3D ( Hyperplane3D< T > hyperplane,
T h,
int nx,
int ny )

Constructor for manual discretization.

Parameters
hyperplaneHyperplane in 3D space
hlattice point spacing
nxX axis resolution
nyY axis resolution

Definition at line 231 of file hyperplaneLattice3D.hh.

234 : _hyperplane(hyperplane),
235 _origin(hyperplane.origin),
236 _u(hyperplane.u),
237 _v(hyperplane.v),
238 _h(h),
239 _nx(nx),
240 _ny(ny)
241{
242 _u = normalize(_u, _h);
243 _v = normalize(_v, _h);
244}
int _ny
Number of lattice points in the direction of _v.
int _nx
Number of lattice points in the direction of _u.

References olb::HyperplaneLattice3D< T >::_h, olb::HyperplaneLattice3D< T >::_u, olb::HyperplaneLattice3D< T >::_v, and olb::normalize().

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [5/5]

template<typename T >
olb::HyperplaneLattice3D< T >::HyperplaneLattice3D ( const HyperplaneLattice3D< T > & )
default

Member Function Documentation

◆ getHyperplane()

template<typename T >
const Hyperplane3D< T > & olb::HyperplaneLattice3D< T >::getHyperplane ( ) const

Definition at line 247 of file hyperplaneLattice3D.hh.

248{
249 return _hyperplane;
250}
+ Here is the caller graph for this function:

◆ getNx()

template<typename T >
int olb::HyperplaneLattice3D< T >::getNx ( ) const
Returns
_nx

Definition at line 263 of file hyperplaneLattice3D.hh.

264{
265 return _nx;
266}

◆ getNy()

template<typename T >
int olb::HyperplaneLattice3D< T >::getNy ( ) const
Returns
_ny

Definition at line 269 of file hyperplaneLattice3D.hh.

270{
271 return _ny;
272}

◆ getPhysOrigin()

template<typename T >
Vector< T, 3 > olb::HyperplaneLattice3D< T >::getPhysOrigin ( ) const
Returns
_origin

Definition at line 281 of file hyperplaneLattice3D.hh.

282{
283 return _origin;
284}

◆ getPhysR()

template<typename T >
Vector< T, 3 > olb::HyperplaneLattice3D< T >::getPhysR ( const int & planeX,
const int & planeY ) const

Transform 2d lattice coordinates to their physical 3d location.

Definition at line 253 of file hyperplaneLattice3D.hh.

254{
255 return Vector<T,3> {
256 _origin[0] + T(planeX)*_u[0] + T(planeY)*_v[0],
257 _origin[1] + T(planeX)*_u[1] + T(planeY)*_v[1],
258 _origin[2] + T(planeX)*_u[2] + T(planeY)*_v[2]
259 };
260}

◆ getPhysSpacing()

template<typename T >
T olb::HyperplaneLattice3D< T >::getPhysSpacing ( ) const
Returns
_h

Definition at line 275 of file hyperplaneLattice3D.hh.

276{
277 return _h;
278}
+ Here is the caller graph for this function:

◆ getVectorU()

template<typename T >
Vector< T, 3 > olb::HyperplaneLattice3D< T >::getVectorU ( ) const
Returns
_u

Definition at line 287 of file hyperplaneLattice3D.hh.

288{
289 return _u;
290}

◆ getVectorV()

template<typename T >
Vector< T, 3 > olb::HyperplaneLattice3D< T >::getVectorV ( ) const
Returns
_v

Definition at line 293 of file hyperplaneLattice3D.hh.

294{
295 return _v;
296}

Member Data Documentation

◆ _h

template<typename T >
T olb::HyperplaneLattice3D< T >::_h
protected

Distance between discrete lattice points.

Definition at line 66 of file hyperplaneLattice3D.h.

◆ _hyperplane

template<typename T >
const Hyperplane3D<T> olb::HyperplaneLattice3D< T >::_hyperplane
protected

Definition at line 51 of file hyperplaneLattice3D.h.

◆ _nx

template<typename T >
int olb::HyperplaneLattice3D< T >::_nx
protected

Number of lattice points in the direction of _u.

Definition at line 68 of file hyperplaneLattice3D.h.

◆ _ny

template<typename T >
int olb::HyperplaneLattice3D< T >::_ny
protected

Number of lattice points in the direction of _v.

Definition at line 70 of file hyperplaneLattice3D.h.

◆ _origin

template<typename T >
Vector<T,3> olb::HyperplaneLattice3D< T >::_origin
protected

Origin vector of the lattice.

Note that this origin is set to a outermost point of the intersection between cuboid geometry and hyperplane. Thus it is different from the Hyperplane3D<T> origin vector in the general case.

Definition at line 59 of file hyperplaneLattice3D.h.

◆ _u

template<typename T >
Vector<T,3> olb::HyperplaneLattice3D< T >::_u
protected

Span vector of the lattice, normalized to grid width _h.

Definition at line 61 of file hyperplaneLattice3D.h.

◆ _v

template<typename T >
Vector<T,3> olb::HyperplaneLattice3D< T >::_v
protected

Span vector of the lattice, normalized to grid width _h.

Definition at line 63 of file hyperplaneLattice3D.h.


The documentation for this class was generated from the following files: