https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SmoothTransitionTestMaterial Class Reference

Class for testing objects derived from SmoothTransition. More...

#include <SmoothTransitionTestMaterial.h>

Inheritance diagram for SmoothTransitionTestMaterial:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 SmoothTransitionTestMaterial (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpProperties () override
 
Real f1 (const Real &x) const
 
Real f2 (const Real &x) const
 
Real df1dx (const Real &x) const
 
Real df2dx (const Real &x) const
 
MaterialProperty< U > & declarePropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for declaring derivative material properties.
 
const MaterialProperty< U > & getMaterialPropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for retrieving derivative material properties.
 
const MaterialProperty< U > & getMaterialPropertyDerivativeTHMPhase (const std::string &base, bool property_is_liquid, const std::string &var_name, bool var_is_liquid, const unsigned int i=0)
 Method for retrieving derivative material properties corresponding to phase-dependent derivatives.
 

Protected Attributes

const MooseEnum_transition_type
 
const VariableValue_var
 
CubicTransition _cubic_transition
 
const WeightedTransition _weighted_transition
 
MaterialProperty< Real > & _matprop
 
MaterialProperty< Real > & _dmatprop_dvar
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

Detailed Description

Class for testing objects derived from SmoothTransition.

Definition at line 19 of file SmoothTransitionTestMaterial.h.

Constructor & Destructor Documentation

◆ SmoothTransitionTestMaterial()

SmoothTransitionTestMaterial::SmoothTransitionTestMaterial ( const InputParameters parameters)

Definition at line 29 of file SmoothTransitionTestMaterial.C.

31
32 _transition_type(getParam<MooseEnum>("transition_type")),
33
34 _var(coupledValue("var")),
35
36 _cubic_transition(0.0, 1.0),
37 _weighted_transition(0.0, 1.0),
38
39 _matprop(declareProperty<Real>("mymatprop")),
40 _dmatprop_dvar(declarePropertyDerivativeTHM<Real>("mymatprop", "var"))
41{
42 const Real & x1 = _cubic_transition.leftEnd();
43 const Real & x2 = _cubic_transition.rightEnd();
44 _cubic_transition.initialize(f1(x1), f2(x2), df1dx(x1), df2dx(x2));
45}
void initialize(const Real &f1_end_value, const Real &f2_end_value, const Real &df1dx_end_value, const Real &df2dx_end_value)
Initializes the polynomial coefficients.
MaterialProperty< Real > & _dmatprop_dvar
const WeightedTransition _weighted_transition
const Real & rightEnd() const
Returns the coordinate of the right end of the transition.
const Real & leftEnd() const
Returns the coordinate of the left end of the transition.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ computeQpProperties()

void SmoothTransitionTestMaterial::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 48 of file SmoothTransitionTestMaterial.C.

49{
50 const Real & x = _var[_qp];
51
52 if (_transition_type == "cubic")
53 {
56 }
57 else if (_transition_type == "weighted")
58 {
61 }
62}
const std::vector< double > x
Real derivative(const Real &x, const Real &df1dx, const Real &df2dx) const
Computes the derivative of the transition value.
virtual Real value(const Real &x, const Real &f1, const Real &f2) const override
Computes the transition value.
Real derivative(const Real &x, const Real &f1, const Real &f2, const Real &df1dx, const Real &df2dx) const
Computes the derivative of the transition value.
virtual Real value(const Real &x, const Real &f1, const Real &f2) const override
Computes the transition value.

◆ declarePropertyDerivativeTHM()

MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::declarePropertyDerivativeTHM ( const std::string &  base,
const std::string &  var_name,
const unsigned int  i = 0 
)
protectedinherited

Method for declaring derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 32 of file DerivativeMaterialInterfaceTHM.h.

91{
92 return this->template declarePropertyDerivative<U>(base, this->coupledName(var_name, i));
93}

◆ df1dx()

Real SmoothTransitionTestMaterial::df1dx ( const Real &  x) const
protected

Definition at line 77 of file SmoothTransitionTestMaterial.C.

78{
79 return 2;
80}

Referenced by computeQpProperties(), and SmoothTransitionTestMaterial().

◆ df2dx()

Real SmoothTransitionTestMaterial::df2dx ( const Real &  x) const
protected

Definition at line 83 of file SmoothTransitionTestMaterial.C.

84{
85 return 1 - x;
86}

Referenced by computeQpProperties(), and SmoothTransitionTestMaterial().

◆ f1()

Real SmoothTransitionTestMaterial::f1 ( const Real &  x) const
protected

Definition at line 65 of file SmoothTransitionTestMaterial.C.

66{
67 return 2 * x + 2;
68}

Referenced by computeQpProperties(), and SmoothTransitionTestMaterial().

◆ f2()

Real SmoothTransitionTestMaterial::f2 ( const Real &  x) const
protected

Definition at line 71 of file SmoothTransitionTestMaterial.C.

72{
73 return -0.5 * std::pow(x - 1, 2) + 1;
74}

Referenced by computeQpProperties(), and SmoothTransitionTestMaterial().

◆ getMaterialPropertyDerivativeTHM()

const MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::getMaterialPropertyDerivativeTHM ( const std::string &  base,
const std::string &  var_name,
const unsigned int  i = 0 
)
protectedinherited

Method for retrieving derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 47 of file DerivativeMaterialInterfaceTHM.h.

101{
102 // get the base property name
103 const std::string prop_name = this->getMaterialPropertyName(base);
104
105 // get the name of the variable which derivative is respect to
106 const std::string der_var_name = this->coupledName(var_name, i);
107
108 return this->template getMaterialPropertyByName<U>(
109 this->derivativePropertyNameFirst(prop_name, der_var_name));
110}
const MaterialPropertyName derivativePropertyNameFirst(const MaterialPropertyName &base, const SymbolName &c1) const

◆ getMaterialPropertyDerivativeTHMPhase()

const MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::getMaterialPropertyDerivativeTHMPhase ( const std::string &  base,
bool  property_is_liquid,
const std::string &  var_name,
bool  var_is_liquid,
const unsigned int  i = 0 
)
protectedinherited

Method for retrieving derivative material properties corresponding to phase-dependent derivatives.

The intended behavior of this function is as follows. If the material property and derivative variable correspond to the same phase, then the material property is retrieved as usual. Else, a zero-valued material property is returned, as it is assumed that the material property depends only upon the variables corresponding to its phase.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
property_is_liquidDoes the property correspond to the liquid phase?
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
var_is_liquidDoes the derivative variable correspond to the liquid phase?
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 71 of file DerivativeMaterialInterfaceTHM.h.

121{
122 if (property_is_liquid == var_is_liquid)
123 {
124 return getMaterialPropertyDerivativeTHM<U>(base, var_name, i);
125 }
126 else
127 {
128 const std::string prop_name = this->getMaterialPropertyName(base);
129 const std::string der_var_name = this->coupledName(var_name, i);
130 const std::string der_prop_name = this->derivativePropertyNameFirst(prop_name, der_var_name);
131 return this->template getZeroMaterialProperty<U>(der_prop_name);
132 }
133}

◆ validParams()

InputParameters SmoothTransitionTestMaterial::validParams ( )
static

Definition at line 15 of file SmoothTransitionTestMaterial.C.

16{
18
19 MooseEnum transition_type("cubic weighted");
20 params.addRequiredParam<MooseEnum>("transition_type", transition_type, "The transition to test");
21
22 params.addRequiredCoupledVar("var", "Variable on which transition depends");
23
24 params.addClassDescription("Class for testing objects derived from SmoothTransition");
25
26 return params;
27}
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _cubic_transition

CubicTransition SmoothTransitionTestMaterial::_cubic_transition
protected

◆ _dmatprop_dvar

MaterialProperty<Real>& SmoothTransitionTestMaterial::_dmatprop_dvar
protected

Definition at line 39 of file SmoothTransitionTestMaterial.h.

Referenced by computeQpProperties().

◆ _matprop

MaterialProperty<Real>& SmoothTransitionTestMaterial::_matprop
protected

Definition at line 38 of file SmoothTransitionTestMaterial.h.

Referenced by computeQpProperties().

◆ _transition_type

const MooseEnum& SmoothTransitionTestMaterial::_transition_type
protected

Definition at line 31 of file SmoothTransitionTestMaterial.h.

Referenced by computeQpProperties().

◆ _var

const VariableValue& SmoothTransitionTestMaterial::_var
protected

Definition at line 33 of file SmoothTransitionTestMaterial.h.

Referenced by computeQpProperties().

◆ _weighted_transition

const WeightedTransition SmoothTransitionTestMaterial::_weighted_transition
protected

Definition at line 36 of file SmoothTransitionTestMaterial.h.

Referenced by computeQpProperties().


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