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

#include <PFCEnergyDensity.h>

Inheritance diagram for PFCEnergyDensity:
[legend]

Public Member Functions

 PFCEnergyDensity (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

std::vector< const VariableValue * > _vals
 
std::vector< const MaterialProperty< Real > * > _coeff
 
unsigned int _order
 
const MaterialProperty< Real > & _a
 
const MaterialProperty< Real > & _b
 

Detailed Description

Definition at line 19 of file PFCEnergyDensity.h.

Constructor & Destructor Documentation

PFCEnergyDensity::PFCEnergyDensity ( const InputParameters &  parameters)

Definition at line 20 of file PFCEnergyDensity.C.

21  : AuxKernel(parameters),
22  _order(coupledComponents("v")),
23  _a(getMaterialProperty<Real>("a")),
24  _b(getMaterialProperty<Real>("b"))
25 {
26  _vals.resize(_order);
27  _coeff.resize(_order);
28 
29  std::string coeff_name_base = "C";
30 
31  for (unsigned int i = 0; i < _order; ++i)
32  {
33  _vals[i] = &coupledValue("v", i);
34  std::string coeff_name = coeff_name_base;
35  std::stringstream out;
36  out << i * 2;
37  coeff_name.append(out.str());
38  _console << coeff_name << std::endl;
39  _coeff[i] = &getMaterialProperty<Real>(coeff_name);
40  }
41 }
const MaterialProperty< Real > & _a
std::vector< const VariableValue * > _vals
const MaterialProperty< Real > & _b
std::vector< const MaterialProperty< Real > * > _coeff
unsigned int _order

Member Function Documentation

Real PFCEnergyDensity::computeValue ( )
protectedvirtual

Definition at line 44 of file PFCEnergyDensity.C.

45 {
46  Real val = Utility::pow<2>((*_vals[0])[_qp]) * (1.0 - (*_coeff[0])[_qp]) / 2.0;
47 
48  // Loop Through Variables
49  // the sign of negative terms have been taken care of by changing the sign of the coefficients;
50  for (unsigned int i = 1; i < _order; ++i)
51  val += (*_coeff[i])[_qp] * (*_vals[0])[_qp] * (*_vals[i])[_qp] / 2.0;
52 
53  val += (_b[_qp] / 12.0 * Utility::pow<4>((*_vals[0])[_qp])) -
54  (_a[_qp] / 6.0 * Utility::pow<3>((*_vals[0])[_qp]));
55 
56  return val;
57 }
const MaterialProperty< Real > & _a
std::vector< const VariableValue * > _vals
const MaterialProperty< Real > & _b
std::vector< const MaterialProperty< Real > * > _coeff
unsigned int _order

Member Data Documentation

const MaterialProperty<Real>& PFCEnergyDensity::_a
protected

Definition at line 31 of file PFCEnergyDensity.h.

Referenced by computeValue().

const MaterialProperty<Real>& PFCEnergyDensity::_b
protected

Definition at line 32 of file PFCEnergyDensity.h.

Referenced by computeValue().

std::vector<const MaterialProperty<Real> *> PFCEnergyDensity::_coeff
protected

Definition at line 28 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().

unsigned int PFCEnergyDensity::_order
protected

Definition at line 30 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().

std::vector<const VariableValue *> PFCEnergyDensity::_vals
protected

Definition at line 27 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().


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