OGS
ProcessLib::ComponentTransport::Field Struct Reference

Detailed Description

Definition at line 30 of file LookupTable.h.

#include <LookupTable.h>

Public Member Functions

 Field (std::vector< std::vector< std::size_t > > point_id_groups_, std::vector< double > seed_points_, std::string name_, int variable_id_)
 
std::pair< double, double > getBoundingSeedPoints (double const value) const
 

Public Attributes

std::vector< std::vector< std::size_t > > const point_id_groups
 
std::vector< double > const seed_points
 
std::string const name
 
int const variable_id
 

Constructor & Destructor Documentation

◆ Field()

ProcessLib::ComponentTransport::Field::Field ( std::vector< std::vector< std::size_t > >  point_id_groups_,
std::vector< double >  seed_points_,
std::string  name_,
int  variable_id_ 
)
inline

Definition at line 32 of file LookupTable.h.

34 : point_id_groups(std::move(point_id_groups_)),
35 seed_points(std::move(seed_points_)),
36 name(std::move(name_)),
37 variable_id(variable_id_)
38 {
39 }
std::vector< double > const seed_points
Definition: LookupTable.h:44
std::vector< std::vector< std::size_t > > const point_id_groups
Definition: LookupTable.h:43

Member Function Documentation

◆ getBoundingSeedPoints()

std::pair< double, double > ProcessLib::ComponentTransport::Field::getBoundingSeedPoints ( double const  value) const

Definition at line 37 of file LookupTable.cpp.

38{
39 auto it = std::lower_bound(seed_points.cbegin(), seed_points.cend(), value);
40 if (it == seed_points.begin())
41 {
42 WARN("The interpolation point is below the lower bound.");
43 auto const nx = std::next(it);
44 return std::make_pair(*it, *nx);
45 }
46 if (it == seed_points.end())
47 {
48 WARN("The interpolation point is above the upper bound.");
49 std::advance(it, -1);
50 }
51
52 auto const pv = std::prev(it);
53 return std::make_pair(*pv, *it);
54}
void WARN(char const *fmt, Args const &... args)
Definition: Logging.h:39

References seed_points, and WARN().

Member Data Documentation

◆ name

std::string const ProcessLib::ComponentTransport::Field::name

Definition at line 45 of file LookupTable.h.

◆ point_id_groups

std::vector<std::vector<std::size_t> > const ProcessLib::ComponentTransport::Field::point_id_groups

Definition at line 43 of file LookupTable.h.

◆ seed_points

std::vector<double> const ProcessLib::ComponentTransport::Field::seed_points

Definition at line 44 of file LookupTable.h.

Referenced by getBoundingSeedPoints().

◆ variable_id

int const ProcessLib::ComponentTransport::Field::variable_id

Definition at line 46 of file LookupTable.h.


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