www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CrossTermBarrierFunctionBase Class Reference

CrossTermBarrierFunctionBase is the base to a set of free energy penalties that set the phase interface barriers for arbitrary pairs of phases. More...

#include <CrossTermBarrierFunctionBase.h>

Inheritance diagram for CrossTermBarrierFunctionBase:
[legend]

Public Member Functions

 CrossTermBarrierFunctionBase (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

std::string _function_name
 name of the function of eta (used to generate the material property names) More...
 
unsigned int _g_order
 polynomial order of the switching function \( g(\eta) \) More...
 
std::vector< Real > _W_ij
 barrier function height matrix More...
 
unsigned int _num_eta
 order parameters More...
 
std::vector< VariableName > _eta_names
 
std::vector< const VariableValue * > _eta
 
MaterialProperty< Real > & _prop_g
 Barrier function and its derivatives. More...
 
std::vector< MaterialProperty< Real > * > _prop_dg
 
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
 
std::vector< const MaterialProperty< Real > * > _h
 Switching functions and their derivatives. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _dh
 

Detailed Description

CrossTermBarrierFunctionBase is the base to a set of free energy penalties that set the phase interface barriers for arbitrary pairs of phases.

Definition at line 23 of file CrossTermBarrierFunctionBase.h.

Constructor & Destructor Documentation

CrossTermBarrierFunctionBase::CrossTermBarrierFunctionBase ( const InputParameters &  parameters)

Definition at line 25 of file CrossTermBarrierFunctionBase.C.

26  : DerivativeMaterialInterface<Material>(parameters),
27  _function_name(getParam<std::string>("function_name")),
28  _g_order(getParam<MooseEnum>("g_order")),
29  _W_ij(getParam<std::vector<Real>>("W_ij")),
30  _num_eta(coupledComponents("etas")),
32  _eta(_num_eta),
33  _prop_g(declareProperty<Real>(_function_name)),
36 {
37  // if Vector W_ij is not the correct size to fill the matrix give error
38  if (_num_eta * _num_eta != _W_ij.size())
39  mooseError("Size of W_ij does not match (number of etas)^2. Supply W_ij of correct size.");
40 
41  // error out if the W_ij diagonal values are not zero
42  for (unsigned int i = 0; i < _num_eta; ++i)
43  if (_W_ij[_num_eta * i + i] != 0)
44  mooseError("Set on-diagonal values of W_ij to zero.");
45 
46  // declare g derivative properties, fetch eta values
47  for (unsigned int i = 0; i < _num_eta; ++i)
48  {
49  _prop_d2g[i].resize(_num_eta);
50  _eta_names[i] = getVar("etas", i)->name();
51  }
52 
53  for (unsigned int i = 0; i < _num_eta; ++i)
54  {
55  _prop_dg[i] = &declarePropertyDerivative<Real>(_function_name, _eta_names[i]);
56  _eta[i] = &coupledValue("etas", i);
57  for (unsigned int j = i; j < _num_eta; ++j)
58  {
59  _prop_d2g[i][j] = _prop_d2g[j][i] =
60  &declarePropertyDerivative<Real>(_function_name, _eta_names[i], _eta_names[j]);
61  }
62  }
63 }
std::vector< Real > _W_ij
barrier function height matrix
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
std::string _function_name
name of the function of eta (used to generate the material property names)
unsigned int _num_eta
order parameters
std::vector< MaterialProperty< Real > * > _prop_dg
std::vector< VariableName > _eta_names
MaterialProperty< Real > & _prop_g
Barrier function and its derivatives.
std::vector< const VariableValue * > _eta
unsigned int _g_order
polynomial order of the switching function

Member Function Documentation

void CrossTermBarrierFunctionBase::computeQpProperties ( )
protectedvirtual

Reimplemented in AsymmetricCrossTermBarrierFunctionMaterial, and CrossTermBarrierFunctionMaterial.

Definition at line 66 of file CrossTermBarrierFunctionBase.C.

Referenced by CrossTermBarrierFunctionMaterial::computeQpProperties(), and AsymmetricCrossTermBarrierFunctionMaterial::computeQpProperties().

67 {
68  // Initialize properties to zero before accumulating
69  _prop_g[_qp] = 0.0;
70  for (unsigned int i = 0; i < _num_eta; ++i)
71  {
72  (*_prop_dg[i])[_qp] = 0.0;
73  (*_prop_d2g[i][i])[_qp] = 0.0;
74  }
75 }
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2g
unsigned int _num_eta
order parameters
std::vector< MaterialProperty< Real > * > _prop_dg
MaterialProperty< Real > & _prop_g
Barrier function and its derivatives.

Member Data Documentation

std::vector<std::vector<const MaterialProperty<Real> *> > CrossTermBarrierFunctionBase::_dh
protected

Definition at line 53 of file CrossTermBarrierFunctionBase.h.

std::vector<const VariableValue *> CrossTermBarrierFunctionBase::_eta
protected
std::vector<VariableName> CrossTermBarrierFunctionBase::_eta_names
protected
std::string CrossTermBarrierFunctionBase::_function_name
protected

name of the function of eta (used to generate the material property names)

Definition at line 32 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionBase().

unsigned int CrossTermBarrierFunctionBase::_g_order
protected

polynomial order of the switching function \( g(\eta) \)

Definition at line 35 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionMaterial::computeQpProperties(), and AsymmetricCrossTermBarrierFunctionMaterial::computeQpProperties().

std::vector<const MaterialProperty<Real> *> CrossTermBarrierFunctionBase::_h
protected

Switching functions and their derivatives.

Definition at line 52 of file CrossTermBarrierFunctionBase.h.

unsigned int CrossTermBarrierFunctionBase::_num_eta
protected
std::vector<std::vector<MaterialProperty<Real> *> > CrossTermBarrierFunctionBase::_prop_d2g
protected
std::vector<MaterialProperty<Real> *> CrossTermBarrierFunctionBase::_prop_dg
protected
MaterialProperty<Real>& CrossTermBarrierFunctionBase::_prop_g
protected
std::vector<Real> CrossTermBarrierFunctionBase::_W_ij
protected

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