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

#include <interface_property_model.h>

Inheritance diagram for InterfacePropertyModel:
[legend]

Public Member Functions

 InterfacePropertyModel ()
virtual ~InterfacePropertyModel ()=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
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 Attributes

std::map< field, bool > model_depends_on

Detailed Description

Abstract class that defines the interface for a interface property model. Interface property model provides an abstract interface to calculate the value of an interface property or a vector of interface 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 23 of file interface_property_model.h.

Constructor & Destructor Documentation

◆ InterfacePropertyModel()

InterfacePropertyModel::InterfacePropertyModel ( )
inline

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

Definition at line 29 of file interface_property_model.h.

References model_depends_on, phase_order_cahn_hilliard, pressure, shear_rate, temperature, and temperature_p1.

◆ ~InterfacePropertyModel()

virtual InterfacePropertyModel::~InterfacePropertyModel ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ depends_on()

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

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

Definition at line 48 of file interface_property_model.h.

References model_depends_on.

◆ jacobian()

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

jacobian Calculates the jacobian (the partial derivative) of the interface property with respect to a field

Parameters
field_valuesValue of the various fields on which the property may depend.
idIndicator of the field with respect to which the jacobian should be calculated
Returns
value of the partial derivative of the property with respect to the field.

Implemented in MobilityCahnHilliardModelConstant, MobilityCahnHilliardModelQuartic, SurfaceTensionConstant, SurfaceTensionLinear, and SurfaceTensionPhaseChange.

◆ numerical_jacobian()

double InterfacePropertyModel::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 104 of file interface_property_model.h.

References value().

◆ value()

virtual double InterfacePropertyModel::value ( const std::map< field, double > & fields_value)
pure virtual

value Calculates the value of an interface property.

Parameters
fields_valueValue of the various field on which the property may depend.
Returns
value of the interface property calculated with the fields_value

Implemented in MobilityCahnHilliardModelConstant, MobilityCahnHilliardModelQuartic, SurfaceTensionConstant, SurfaceTensionLinear, and SurfaceTensionPhaseChange.

◆ vector_jacobian()

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

vector_jacobian Calculate the derivative of the property with respect to a field

Parameters
field_vectorsVector for the values of the fields used to evaluate the property
idIdentifier of the field with respect to which a derivative should be calculated
jacobianVector of the value of the derivative of the property with respect to the field id

Implemented in MobilityCahnHilliardModelConstant, MobilityCahnHilliardModelQuartic, SurfaceTensionConstant, SurfaceTensionLinear, and SurfaceTensionPhaseChange.

◆ vector_numerical_jacobian()

void InterfacePropertyModel::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 125 of file interface_property_model.h.

References vector_value().

◆ vector_value()

virtual void InterfacePropertyModel::vector_value ( const std::map< field, std::vector< double > > & field_vectors,
std::vector< double > & property_vector )
pure virtual

vector_value Calculates the values of an interface property for multiple points

Parameters
field_vectors

Implemented in MobilityCahnHilliardModelConstant, MobilityCahnHilliardModelQuartic, SurfaceTensionConstant, SurfaceTensionLinear, and SurfaceTensionPhaseChange.

Member Data Documentation

◆ model_depends_on

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

Definition at line 160 of file interface_property_model.h.


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