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 19 of file DerivativeMaterialPropertyNameInterface.h.

Member Function Documentation

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 7 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeMaterialInterface< T >::declarePropertyDerivative(), DerivativeMaterialInterface< T >::getMaterialPropertyDerivative(), DerivativeMaterialInterface< T >::getMaterialPropertyDerivativeByName(), MaterialDerivativeTestAction::MaterialDerivativeTestAction(), propertyNameSecond(), propertyNameThird(), and DerivativeMaterialInterface< T >::validateCouplingHelper().

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

Referenced by DerivativeMaterialInterface< T >::declarePropertyDerivative(), DerivativeMaterialInterface< T >::getMaterialPropertyDerivative(), and DerivativeMaterialInterface< T >::getMaterialPropertyDerivativeByName().

49 {
50  return "d" + base + "/d" + c1;
51 }
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 54 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeMaterialInterface< T >::declarePropertyDerivative(), DerivativeMaterialInterface< T >::getMaterialPropertyDerivative(), and DerivativeMaterialInterface< T >::getMaterialPropertyDerivativeByName().

57 {
58  return propertyName(base, {c1, c2});
59 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.
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 62 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeMaterialInterface< T >::declarePropertyDerivative(), DerivativeMaterialInterface< T >::getMaterialPropertyDerivative(), and DerivativeMaterialInterface< T >::getMaterialPropertyDerivativeByName().

66 {
67  return propertyName(base, {c1, c2, c3});
68 }
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: