www.mooseframework.org
Public Member Functions | List of all members
DerivativeMaterialPropertyNameInterface Class Reference

#include <DerivativeMaterialPropertyNameInterface.h>

Inheritance diagram for DerivativeMaterialPropertyNameInterface:
[legend]

Public Member Functions

const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< VariableName > &c) const
 Helper functions to generate the material property names for the arbitrary derivatives. More...
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const VariableName &c1) const
 Helper functions to generate the material property names for the first derivatives. More...
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2) const
 Helper functions to generate the material property names for the second derivatives. More...
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2, const VariableName &c3) const
 Helper functions to generate the material property names for the third derivatives. More...
 

Detailed Description

Definition at line 15 of file DerivativeMaterialPropertyNameInterface.h.

Member Function Documentation

◆ propertyName()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyName ( const MaterialPropertyName &  base,
const std::vector< VariableName > &  c 
) const

Helper functions to generate the material property names for the arbitrary derivatives.

Definition at line 15 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by FunctionMaterialPropertyDescriptor::getPropertyName(), propertyNameSecond(), and propertyNameThird().

17 {
18  // to obtain well defined names we sort alphabetically
19  std::vector<VariableName> a(c);
20  std::sort(a.begin(), a.end());
21 
22  // derivative order
23  unsigned int order = a.size();
24  if (order == 0)
25  return base;
26 
27  // build the property name as a stringstream
28  std::stringstream name;
29 
30  // build numerator
31  name << 'd';
32  if (order > 1)
33  name << '^' << order;
34  name << base << '/';
35 
36  // build denominator with 'pretty' names using exponents rather than repeat multiplication
37  unsigned int exponent = 1;
38  for (unsigned i = 1; i <= order; ++i)
39  {
40  if (i == order || a[i - 1] != a[i])
41  {
42  name << 'd' << a[i - 1];
43  if (exponent > 1)
44  name << '^' << exponent;
45  exponent = 1;
46  }
47  else
48  exponent++;
49  }
50 
51  return name.str();
52 }

◆ propertyNameFirst()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameFirst ( const MaterialPropertyName &  base,
const VariableName &  c1 
) const

Helper functions to generate the material property names for the first derivatives.

Definition at line 55 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

57 {
58  return "d" + base + "/d" + c1;
59 }

◆ propertyNameSecond()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameSecond ( const MaterialPropertyName &  base,
const VariableName &  c1,
const VariableName &  c2 
) const

Helper functions to generate the material property names for the second derivatives.

Definition at line 62 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

65 {
66  return propertyName(base, {c1, c2});
67 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ propertyNameThird()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameThird ( const MaterialPropertyName &  base,
const VariableName &  c1,
const VariableName &  c2,
const VariableName &  c3 
) const

Helper functions to generate the material property names for the third derivatives.

Definition at line 70 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

74 {
75  return propertyName(base, {c1, c2, c3});
76 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

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