57 T
project(T x)
const override {
return x; }
59 T
inverse(T x)
const override {
return x; }
76 template <
typename DESCRIPTOR>
78 :
scale {converter.getConversionFactorMass() / converter.getConversionFactorForce()}
90 T
derivative(T x)
const override {
return (x >= T(1) ? T(1)/(x*x) : T(0)); }
91 T
inverse(T x)
const override {
return T(1)/(T(1)-x); }
109 const T y = T(0.5) + T(0.5) *
util::sin((x-T(0.5))*
pi);
141template<
typename T,
typename DESCRIPTOR>
154 return projection.
inverse(porosity);
158template<
typename T,
typename DESCRIPTOR>
162 return (T(1) -
gridTerm(converter) / permeability);
166template<
typename T,
typename DESCRIPTOR>
176template<
typename T,
typename DESCRIPTOR>
189 clout <<
"Transform porosity startValue into control startValue:\n";
190 clout <<
"Porosity: " << startValue << std::endl;
191 clout <<
"Control: " <<
control << std::endl;
198 clout <<
"Transform permeability startValue into control startValue:\n";
199 clout <<
"Permeability: " << startValue << std::endl;
200 clout <<
"Porosity: " << tmpPorosity << std::endl;
201 clout <<
"Control: " <<
control << std::endl;
209 throw std::invalid_argument(
210 "Error: unknown start value type.");
215template<
typename T,
typename OptiCaseDual_Type>
219 *(optiCase._projection),
220 *(optiCase._converter),
221 optiCase._startValueType,
234template <
typename T,
typename DESCRIPTOR>
259template <
typename T,
typename DESCRIPTOR>
263 :
GiBase<T,DESCRIPTOR>{converter}
275template <
typename T,
typename DESCRIPTOR>
281 :
GiBase<T,DESCRIPTOR>(converter),
_n(n)
299template <
typename T,
typename DESCRIPTOR>
305 :
GiBase<T,DESCRIPTOR>(converter),
_n(n)
319template <
typename T,
typename DESCRIPTOR>
324 if (name ==
"Identity") {
325 return std::make_shared<Identity<T>>();
326 }
else if (name ==
"Sigmoid") {
327 return std::make_shared<Sigmoid<T>>();
328 }
else if (name ==
"ForceFactor") {
329 return std::make_shared<ForceFactor<T>>(converter);
330 }
else if (name ==
"Rectifier") {
331 return std::make_shared<Rectifier<T>>();
332 }
else if (name ==
"Softplus") {
333 return std::make_shared<Softplus<T>>();
334 }
else if (name ==
"Baron") {
335 return std::make_shared<Baron<T>>();
336 }
else if (name ==
"Krause") {
337 return std::make_shared<Krause<T>>();
338 }
else if (name ==
"Foerster") {
339 return std::make_shared<Foerster<T,DESCRIPTOR>>(converter);
340 }
else if (std::regex_match(name, match, std::regex (
"(Foerster)([0-9])"))) {
341 const unsigned n = std::stoi(match[2]);
342 return std::make_shared<FoersterN<T,DESCRIPTOR>>(converter, n);
343 }
else if (std::regex_match(name, match, std::regex (
"(Stasius)([0-9])"))) {
344 const unsigned n = std::stoi(match[2]);
345 return std::make_shared<StasiusN<T,DESCRIPTOR>>(converter, n);
347 throw std::invalid_argument(
348 "Error: unknown projection name selected.");
class for marking output with some text
Conversion between physical and lattice units, as well as discretization.
constexpr T getLatticeViscosity() const
conversion from physical to lattice viscosity
constexpr T getLatticeRelaxationTime() const
return relaxation time in lattice units
constexpr T getPhysDeltaX() const
returns grid spacing (voxel length) in m
std::shared_ptr< projection::Base< T > > construct(const UnitConverter< T, DESCRIPTOR > &converter, std::string &name)
T porosityToControl(T porosity, const Base< T > &projection)
Get control value for given porosity.
T permeabilityToControl(T permeability, const Base< T > &projection, const UnitConverter< T, DESCRIPTOR > &converter)
Get control for given permeability.
T getInitialControl(T startValue, const Base< T > &projection, const UnitConverter< T, DESCRIPTOR > &converter, StartValueType type, bool verbose=true)
Transform porosity/ permeability/ other startValue into control.
T permeabilityToPorosity(T permeability, const UnitConverter< T, DESCRIPTOR > &converter)
Get porosity for given permeability.
T gridTerm(const UnitConverter< T, DESCRIPTOR > &converter)
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
ADf< T, DIM > log(const ADf< T, DIM > &a)
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
ADf< T, DIM > sin(const ADf< T, DIM > &a)
ADf< T, DIM > asin(const ADf< T, DIM > &a)
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
ADf< T, DIM > atan(const ADf< T, DIM > &a)
ADf< T, DIM > exp(const ADf< T, DIM > &a)
ADf< T, DIM > cos(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
#define OLB_PRECONDITION(COND)
T derivative(T x) const override
T project(T x) const override
T inverse(T x) const override
virtual T inverse(T) const =0
virtual T derivative(T) const =0
virtual T project(T) const =0
FoersterProjection for arbitrary n.
T subprojection(T x) const override
FoersterN(const UnitConverter< T, DESCRIPTOR > &converter, unsigned n)
T derivSubprojection(T x) const override
T inverseSubprojection(T x) const override
Foerster(const UnitConverter< T, DESCRIPTOR > &converter)
T subprojection(T x) const override
T derivSubprojection(T x) const override
T inverseSubprojection(T x) const override
Convert force to lattice units.
T project(T x) const override
ForceFactor(const UnitConverter< T, DESCRIPTOR > &converter)
T inverse(T x) const override
T derivative(T x) const override
Gridterm-dependent projection base class.
virtual T inverseSubprojection(T x) const =0
T project(T x) const override
virtual T derivSubprojection(T x) const =0
GiBase(const UnitConverter< T, DESCRIPTOR > &converter)
T inverse(T x) const override
virtual T subprojection(T x) const =0
T derivative(T x) const override
T derivative(T x) const override
T inverse(T x) const override
T project(T x) const override
T project(T x) const override
T derivative(T x) const override
T inverse(T x) const override
T derivative(T x) const override
T project(T x) const override
T inverse(T x) const override
T project(T x) const override
T inverse(T x) const override
T derivative(T x) const override
T derivative(T x) const override
T project(T x) const override
T inverse(T x) const override
StasiusProjection for arbitrary n.
T inverseSubprojection(T x) const override
StasiusN(const UnitConverter< T, DESCRIPTOR > &converter, unsigned n)
T derivSubprojection(T x) const override
T subprojection(T x) const override
Unit conversion handling – header file.