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 26 of file CrossTermBarrierFunctionBase.h.

Constructor & Destructor Documentation

◆ CrossTermBarrierFunctionBase()

CrossTermBarrierFunctionBase::CrossTermBarrierFunctionBase ( const InputParameters &  parameters)

Definition at line 28 of file CrossTermBarrierFunctionBase.C.

29  : DerivativeMaterialInterface<Material>(parameters),
30  _function_name(getParam<std::string>("function_name")),
31  _g_order(getParam<MooseEnum>("g_order")),
32  _W_ij(getParam<std::vector<Real>>("W_ij")),
33  _num_eta(coupledComponents("etas")),
35  _eta(_num_eta),
36  _prop_g(declareProperty<Real>(_function_name)),
39 {
40  // if Vector W_ij is not the correct size to fill the matrix give error
41  if (_num_eta * _num_eta != _W_ij.size())
42  paramError("W_ij",
43  "Size of W_ij does not match (number of etas)^2. Supply W_ij of correct size.");
44 
45  // error out if the W_ij diagonal values are not zero
46  for (unsigned int i = 0; i < _num_eta; ++i)
47  if (_W_ij[_num_eta * i + i] != 0)
48  paramError("W_ij", "Set on-diagonal values of W_ij to zero.");
49 
50  // declare g derivative properties, fetch eta values
51  for (unsigned int i = 0; i < _num_eta; ++i)
52  {
53  _prop_d2g[i].resize(_num_eta);
54  _eta_names[i] = getVar("etas", i)->name();
55  }
56 
57  for (unsigned int i = 0; i < _num_eta; ++i)
58  {
59  _prop_dg[i] = &declarePropertyDerivative<Real>(_function_name, _eta_names[i]);
60  _eta[i] = &coupledValue("etas", i);
61  for (unsigned int j = i; j < _num_eta; ++j)
62  {
63  _prop_d2g[i][j] = _prop_d2g[j][i] =
64  &declarePropertyDerivative<Real>(_function_name, _eta_names[i], _eta_names[j]);
65  }
66  }
67 }
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

◆ computeQpProperties()

void CrossTermBarrierFunctionBase::computeQpProperties ( )
protectedvirtual

Reimplemented in AsymmetricCrossTermBarrierFunctionMaterial, and CrossTermBarrierFunctionMaterial.

Definition at line 70 of file CrossTermBarrierFunctionBase.C.

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

71 {
72  // Initialize properties to zero before accumulating
73  _prop_g[_qp] = 0.0;
74  for (unsigned int i = 0; i < _num_eta; ++i)
75  {
76  (*_prop_dg[i])[_qp] = 0.0;
77  (*_prop_d2g[i][i])[_qp] = 0.0;
78  }
79 }
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

◆ _dh

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

Definition at line 56 of file CrossTermBarrierFunctionBase.h.

◆ _eta

std::vector<const VariableValue *> CrossTermBarrierFunctionBase::_eta
protected

◆ _eta_names

std::vector<VariableName> CrossTermBarrierFunctionBase::_eta_names
protected

◆ _function_name

std::string CrossTermBarrierFunctionBase::_function_name
protected

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

Definition at line 35 of file CrossTermBarrierFunctionBase.h.

Referenced by CrossTermBarrierFunctionBase().

◆ _g_order

unsigned int CrossTermBarrierFunctionBase::_g_order
protected

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

Definition at line 38 of file CrossTermBarrierFunctionBase.h.

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

◆ _h

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

Switching functions and their derivatives.

Definition at line 55 of file CrossTermBarrierFunctionBase.h.

◆ _num_eta

unsigned int CrossTermBarrierFunctionBase::_num_eta
protected

◆ _prop_d2g

std::vector<std::vector<MaterialProperty<Real> *> > CrossTermBarrierFunctionBase::_prop_d2g
protected

◆ _prop_dg

std::vector<MaterialProperty<Real> *> CrossTermBarrierFunctionBase::_prop_dg
protected

◆ _prop_g

MaterialProperty<Real>& CrossTermBarrierFunctionBase::_prop_g
protected

◆ _W_ij

std::vector<Real> CrossTermBarrierFunctionBase::_W_ij
protected

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