Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
PhysicalPropertyModel Class Referenceabstract

#include <physical_property_model.h>

Inheritance diagram for PhysicalPropertyModel:
[legend]

Public Types

enum class  ComplexComponent : std::int8_t { real , imag }

Public Member Functions

 PhysicalPropertyModel ()
virtual ~PhysicalPropertyModel ()=default
bool depends_on (const field &id)
virtual double value (const std::map< field, double > &fields_value)=0
virtual void vector_value (const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector)=0
virtual double jacobian (const std::map< field, double > &field_values, const field id)=0
virtual void vector_jacobian (const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)=0
void provide_simulation_control (std::shared_ptr< SimulationControl > &p_simulation_control)
double numerical_jacobian (const std::map< field, double > &field_values, const field id)
void vector_numerical_jacobian (const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)

Protected Member Functions

std::shared_ptr< SimulationControl > & get_simulation_control ()

Protected Attributes

std::map< field, bool > model_depends_on

Private Attributes

std::shared_ptr< SimulationControl > simulation_control

Detailed Description

Abstract class that defines the interface for a physical property model Physical property model provides an abstract interface to calculate the value of a physical property or a vector of physical property value for given field value. By default, the interface does not require that all (or any) fields be specified. This is why a map is used to pass the dependent variable. To allow for the calculation of the appropriate jacobian matrix (when that is necessary) the interface also provides a jacobian function, which must provide the derivative with respect to the field specified as an argument.

Definition at line 77 of file physical_property_model.h.

Member Enumeration Documentation

◆ ComplexComponent

enum class PhysicalPropertyModel::ComplexComponent : std::int8_t
strong

Part of a complex physical property returned by a model. A PhysicalPropertyModel can only return a single double value, so this flag is used to select which part of the complex property is returned.

Enumerator
real 
imag 

Definition at line 85 of file physical_property_model.h.

Constructor & Destructor Documentation

◆ PhysicalPropertyModel()

PhysicalPropertyModel::PhysicalPropertyModel ( )
inline

Default constructor. Set the model_depends_on to false for all variables.

Definition at line 94 of file physical_property_model.h.

References levelset, model_depends_on, phase_order_cahn_hilliard, pressure, shear_rate, temperature, temperature_p1, temperature_p2, tracer_concentration, and void_fraction.

◆ ~PhysicalPropertyModel()

virtual PhysicalPropertyModel::~PhysicalPropertyModel ( )
virtualdefault

Default virtual destructor. Does not do anything.

Member Function Documentation

◆ depends_on()

bool PhysicalPropertyModel::depends_on ( const field & id)
inline

Returns true if the PhysicalPropertyModel depends on a field, false if not.

Definition at line 117 of file physical_property_model.h.

References model_depends_on.

◆ get_simulation_control()

std::shared_ptr< SimulationControl > & PhysicalPropertyModel::get_simulation_control ( )
inlineprotected

Definition at line 243 of file physical_property_model.h.

References simulation_control.

◆ jacobian()

virtual double PhysicalPropertyModel::jacobian ( const std::map< field, double > & field_values,
const field id )
pure virtual

◆ numerical_jacobian()

double PhysicalPropertyModel::numerical_jacobian ( const std::map< field, double > & field_values,
const field id )
inline

numerical_jacobian Calculates the jacobian through a forward finite difference (Euler) approximation. This approach, although not preferable, is meant as a fall-back when calculating the jacobian manually is too difficult.

Parameters
fields_valuesThe values of the various fields
idField id of the field with respect to which the jacobian should be calculated
Returns

Definition at line 187 of file physical_property_model.h.

References value().

◆ provide_simulation_control()

void PhysicalPropertyModel::provide_simulation_control ( std::shared_ptr< SimulationControl > & p_simulation_control)
inline

Provides the physical property with the simulation control object ensuring that the PhysicalPropertyModel can calculate physical properties that depend on time or time-history.

Parameters
p_simulation_controlshared pointed to a SimulationControl object. A copy of this shared pointer is stored in the physical property.

Definition at line 172 of file physical_property_model.h.

References simulation_control.

◆ value()

◆ vector_jacobian()

virtual void PhysicalPropertyModel::vector_jacobian ( const std::map< field, std::vector< double > > & field_vectors,
const field id,
std::vector< double > & jacobian_vector )
pure virtual

◆ vector_numerical_jacobian()

void PhysicalPropertyModel::vector_numerical_jacobian ( const std::map< field, std::vector< double > > & field_vectors,
const field id,
std::vector< double > & jacobian_vector )
inline

vector_numerical_jacobian Calculates the vector of jacobian through forward finite difference (Euler) approximation. This approach, although not preferable, is meant as a fall-back when calculating the jacobian manually is too difficult.

Parameters
field_vectors
field_id
jacobian_vector
Returns

Definition at line 208 of file physical_property_model.h.

References vector_value().

◆ vector_value()

Member Data Documentation

◆ model_depends_on

std::map<field, bool> PhysicalPropertyModel::model_depends_on
protected

Definition at line 250 of file physical_property_model.h.

◆ simulation_control

std::shared_ptr<SimulationControl> PhysicalPropertyModel::simulation_control
private

Definition at line 257 of file physical_property_model.h.


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