OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::HyperplaneLattice2D< T > Class Template Reference

Parametrization of a hyperplane lattice (i.e. a line lattice). More...

#include <hyperplaneLattice2D.h>

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

Public Member Functions

 HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane)
 Constructor for automatic discretization.
 
 HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane, int resolution)
 Constructor for discretization of a given resolution.
 
 HyperplaneLattice2D (CuboidGeometry2D< T > &geometry, Hyperplane2D< T > hyperplane, T h)
 Constructor for discretization of a given grid width.
 
 HyperplaneLattice2D (const HyperplaneLattice2D &)=default
 
const Hyperplane2D< T > & getHyperplane () const
 
Vector< T, 2 > getPhysR (const int &n) const
 Transform 1d lattice coordinates to their physical 2d location.
 
int getN () const
 
getPhysSpacing () const
 
Vector< T, 2 > getPhysOrigin () const
 
Vector< T, 2 > getVectorU () const
 

Protected Attributes

const Hyperplane2D< T > _hyperplane
 
Vector< T, 2 > _origin
 Origin vector of the lattice.
 
Vector< T, 2 > _u
 Direction vector of the lattice, normalized to grid width _h.
 
_h
 Distance between discrete lattice points.
 
int _n
 Number of lattice points in the direction of _u.
 

Detailed Description

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

Parametrization of a hyperplane lattice (i.e. a line lattice).

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

Definition at line 39 of file hyperplaneLattice2D.h.

Constructor & Destructor Documentation

◆ HyperplaneLattice2D() [1/4]

template<typename T >
olb::HyperplaneLattice2D< T >::HyperplaneLattice2D ( CuboidGeometry2D< T > & geometry,
Hyperplane2D< T > hyperplane )

Constructor for automatic discretization.

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

Definition at line 103 of file hyperplaneLattice2D.hh.

105 : _geometry(geometry),
106 _hyperplane(hyperplane),
107 _origin(hyperplane.origin),
108 _u(hyperplane.u),
109 _h(geometry.getMinDeltaR())
110{
111 _u = normalize(_u, _h);
112
113 const int maxLatticeDistance = computeMaxLatticeDistance();
114 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
115 constructCuboid(maxLatticeDistance);
116}
const Hyperplane2D< T > _hyperplane
Vector< T, 2 > _origin
Origin vector of the lattice.
T _h
Distance between discrete lattice points.
Vector< T, 2 > _u
Direction vector of the lattice, normalized to grid width _h.
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Definition vector.h:245

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

+ Here is the call graph for this function:

◆ HyperplaneLattice2D() [2/4]

template<typename T >
olb::HyperplaneLattice2D< T >::HyperplaneLattice2D ( CuboidGeometry2D< T > & geometry,
Hyperplane2D< T > hyperplane,
int resolution )

Constructor for discretization of a given resolution.

Definition at line 119 of file hyperplaneLattice2D.hh.

121 : _geometry(geometry),
122 _hyperplane(hyperplane),
123 _origin(hyperplane.origin),
124 _u(hyperplane.u),
125 _h(geometry.getMinDeltaR())
126{
127 _u = normalize(_u, _h);
128
129 const int maxLatticeDistance = computeMaxLatticeDistance();
130 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
131 constructCuboid(maxLatticeDistance);
132
133 if ( resolution > 0 ) {
134 setToResolution(resolution);
135 }
136}

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

+ Here is the call graph for this function:

◆ HyperplaneLattice2D() [3/4]

template<typename T >
olb::HyperplaneLattice2D< T >::HyperplaneLattice2D ( CuboidGeometry2D< T > & geometry,
Hyperplane2D< T > hyperplane,
T h )

Constructor for discretization of a given grid width.

Definition at line 139 of file hyperplaneLattice2D.hh.

141 : _geometry(geometry),
142 _hyperplane(hyperplane),
143 _origin(hyperplane.origin),
144 _u(hyperplane.u),
145 _h(h)
146{
147 if ( util::nearZero(_h) ) {
148 _h = _geometry.getMinDeltaR();
149 }
150
151 _u = normalize(_u, _h);
152
153 const int maxLatticeDistance = computeMaxLatticeDistance();
154 // compute _hyperplane.origin, _nx, _ny so that the cuboid is right inside the geometry
155 constructCuboid(maxLatticeDistance);
156}
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::HyperplaneLattice2D< T >::_h, olb::HyperplaneLattice2D< T >::_u, olb::util::nearZero(), and olb::normalize().

+ Here is the call graph for this function:

◆ HyperplaneLattice2D() [4/4]

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

Member Function Documentation

◆ getHyperplane()

template<typename T >
const Hyperplane2D< T > & olb::HyperplaneLattice2D< T >::getHyperplane ( ) const

Definition at line 159 of file hyperplaneLattice2D.hh.

160{
161 return _hyperplane;
162}
+ Here is the caller graph for this function:

◆ getN()

template<typename T >
int olb::HyperplaneLattice2D< T >::getN ( ) const
Returns
_n

Definition at line 174 of file hyperplaneLattice2D.hh.

175{
176 return _n;
177}
int _n
Number of lattice points in the direction of _u.

◆ getPhysOrigin()

template<typename T >
Vector< T, 2 > olb::HyperplaneLattice2D< T >::getPhysOrigin ( ) const
Returns
_origin

Definition at line 186 of file hyperplaneLattice2D.hh.

187{
188 return _origin;
189}

◆ getPhysR()

template<typename T >
Vector< T, 2 > olb::HyperplaneLattice2D< T >::getPhysR ( const int & n) const

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

Definition at line 165 of file hyperplaneLattice2D.hh.

166{
167 return Vector<T,2> {
168 _origin[0] + T(n)*_u[0],
169 _origin[1] + T(n)*_u[1]
170 };
171}

◆ getPhysSpacing()

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

Definition at line 180 of file hyperplaneLattice2D.hh.

181{
182 return _h;
183}
+ Here is the caller graph for this function:

◆ getVectorU()

template<typename T >
Vector< T, 2 > olb::HyperplaneLattice2D< T >::getVectorU ( ) const
Returns
_u

Definition at line 192 of file hyperplaneLattice2D.hh.

193{
194 return _u;
195}

Member Data Documentation

◆ _h

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

Distance between discrete lattice points.

Definition at line 64 of file hyperplaneLattice2D.h.

◆ _hyperplane

template<typename T >
const Hyperplane2D<T> olb::HyperplaneLattice2D< T >::_hyperplane
protected

Definition at line 51 of file hyperplaneLattice2D.h.

◆ _n

template<typename T >
int olb::HyperplaneLattice2D< T >::_n
protected

Number of lattice points in the direction of _u.

Definition at line 66 of file hyperplaneLattice2D.h.

◆ _origin

template<typename T >
Vector<T,2> olb::HyperplaneLattice2D< 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 Hyperplane2D<T> origin vector in the general case.

Definition at line 59 of file hyperplaneLattice2D.h.

◆ _u

template<typename T >
Vector<T,2> olb::HyperplaneLattice2D< T >::_u
protected

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

Definition at line 61 of file hyperplaneLattice2D.h.


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