OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
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 (CuboidGeometry3D< T > &geometry, Hyperplane3D< T > hyperplane)
 Constructor for automatic discretization.
 
 HyperplaneLattice3D (CuboidGeometry3D< T > &geometry, Hyperplane3D< T > hyperplane, int resolution)
 Constructor for discretization of a given resolution.
 
 HyperplaneLattice3D (CuboidGeometry3D< T > &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 CuboidGeometry3D<T>.

Definition at line 41 of file hyperplaneLattice3D.h.

Constructor & Destructor Documentation

◆ HyperplaneLattice3D() [1/5]

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

Constructor for automatic discretization.

i.e. the grid width is set to CuboidGeometry3D<T>::getMinDeltaR.

Definition at line 173 of file hyperplaneLattice3D.hh.

175 : _hyperplane(hyperplane),
176 _origin(hyperplane.origin),
177 _u(hyperplane.u),
178 _v(hyperplane.v),
179 _h(geometry.getMinDeltaR())
180{
181 _u = normalize(_u, _h);
182 _v = normalize(_v, _h);
183
184 const int maxLatticeDistance = computeMaxLatticeDistance(geometry.getMotherCuboid());
185 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
186 constructCuboid(geometry, maxLatticeDistance);
187}
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:245

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

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [2/5]

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

Constructor for discretization of a given resolution.

Definition at line 190 of file hyperplaneLattice3D.hh.

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

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

+ Here is the call graph for this function:

◆ HyperplaneLattice3D() [3/5]

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

Constructor for discretization of a given grid width.

Definition at line 211 of file hyperplaneLattice3D.hh.

213 : _hyperplane(hyperplane),
214 _origin(hyperplane.origin),
215 _u(hyperplane.u),
216 _v(hyperplane.v),
217 _h(h)
218{
219 if ( util::nearZero(_h) ) {
220 _h = geometry.getMinDeltaR();
221 }
222
223 _u = normalize(_u, _h);
224 _v = normalize(_v, _h);
225
226 const int maxLatticeDistance = computeMaxLatticeDistance(geometry.getMotherCuboid());
227 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
228 constructCuboid(geometry, maxLatticeDistance);
229}
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::HyperplaneLattice3D< T >::_h, olb::HyperplaneLattice3D< T >::_u, olb::HyperplaneLattice3D< T >::_v, olb::CuboidGeometry3D< T >::getMinDeltaR(), olb::CuboidGeometry3D< T >::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 232 of file hyperplaneLattice3D.hh.

235 : _hyperplane(hyperplane),
236 _origin(hyperplane.origin),
237 _u(hyperplane.u),
238 _v(hyperplane.v),
239 _h(h),
240 _nx(nx),
241 _ny(ny)
242{
243 _u = normalize(_u, _h);
244 _v = normalize(_v, _h);
245}
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 248 of file hyperplaneLattice3D.hh.

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

◆ getNx()

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

Definition at line 264 of file hyperplaneLattice3D.hh.

265{
266 return _nx;
267}

◆ getNy()

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

Definition at line 270 of file hyperplaneLattice3D.hh.

271{
272 return _ny;
273}

◆ getPhysOrigin()

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

Definition at line 282 of file hyperplaneLattice3D.hh.

283{
284 return _origin;
285}

◆ 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 254 of file hyperplaneLattice3D.hh.

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

◆ getPhysSpacing()

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

Definition at line 276 of file hyperplaneLattice3D.hh.

277{
278 return _h;
279}
+ 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 288 of file hyperplaneLattice3D.hh.

289{
290 return _u;
291}

◆ getVectorV()

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

Definition at line 294 of file hyperplaneLattice3D.hh.

295{
296 return _v;
297}

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: