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 36 of file LookupTable.cpp.

37{
38 if (seed_points.size() < 2)
39 {
40 OGS_FATAL("The lookup table for seed_points has less then two values.");
41 }
42
43 auto lower =
44 std::lower_bound(seed_points.cbegin(), seed_points.cend(), value);
45 if (lower == seed_points.begin())
46 {
47 WARN("The interpolation point is below the lower bound.");
48 return std::make_pair(seed_points[0], seed_points[1]);
49 }
50 if (lower == seed_points.end())
51 {
52 WARN("The interpolation point is above the upper bound.");
53 return std::make_pair(seed_points[seed_points.size() - 2],
54 seed_points[seed_points.size() - 1]);
55 }
56
57 auto const upper = lower--;
58 return std::make_pair(*lower, *upper);
59}
#define OGS_FATAL(...)
Definition Error.h:26
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40

References OGS_FATAL, 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: