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

Calculate total grain boundary length in 2D and area in 3D. More...

#include <GrainBoundaryArea.h>

Inheritance diagram for GrainBoundaryArea:
[legend]

Public Member Functions

 GrainBoundaryArea (const InputParameters &parameters)
 
virtual Real getValue () override
 

Protected Member Functions

virtual Real computeQpIntegral () override
 

Protected Attributes

const unsigned int _op_num
 Number of order parameters. More...
 
std::vector< const VariableGradient * > _grads
 Order parameters. More...
 
const Real _factor
 normalization factor, depending on order parameter range and grains per side More...
 

Detailed Description

Calculate total grain boundary length in 2D and area in 3D.

Definition at line 21 of file GrainBoundaryArea.h.

Constructor & Destructor Documentation

GrainBoundaryArea::GrainBoundaryArea ( const InputParameters &  parameters)

Definition at line 32 of file GrainBoundaryArea.C.

33  : ElementIntegralPostprocessor(parameters),
34  _op_num(coupledComponents("v")),
35  _grads(_op_num),
36  _factor(getParam<Real>("grains_per_side") * getParam<Real>("op_range"))
37 {
38  // make sure user input is valid
39  if (MooseUtils::absoluteFuzzyEqual(_factor, 0.0))
40  mooseError("Neither grains_per_side nor op_range may be zero.");
41 
42  // Loop over variables (ops)
43  for (auto op_index = decltype(_op_num)(0); op_index < _op_num; ++op_index)
44  _grads[op_index] = &coupledGradient("v", op_index);
45 }
std::vector< const VariableGradient * > _grads
Order parameters.
const unsigned int _op_num
Number of order parameters.
const Real _factor
normalization factor, depending on order parameter range and grains per side

Member Function Documentation

Real GrainBoundaryArea::computeQpIntegral ( )
overrideprotectedvirtual

Definition at line 48 of file GrainBoundaryArea.C.

49 {
50  Real grad_sum = 0.0;
51  for (auto grad : _grads)
52  grad_sum += (*grad)[_qp].norm();
53  return grad_sum;
54 }
std::vector< const VariableGradient * > _grads
Order parameters.
Real GrainBoundaryArea::getValue ( )
overridevirtual

Definition at line 57 of file GrainBoundaryArea.C.

58 {
59  return ElementIntegralPostprocessor::getValue() / _factor;
60 }
const Real _factor
normalization factor, depending on order parameter range and grains per side

Member Data Documentation

const Real GrainBoundaryArea::_factor
protected

normalization factor, depending on order parameter range and grains per side

Definition at line 38 of file GrainBoundaryArea.h.

Referenced by getValue(), and GrainBoundaryArea().

std::vector<const VariableGradient *> GrainBoundaryArea::_grads
protected

Order parameters.

Definition at line 35 of file GrainBoundaryArea.h.

Referenced by computeQpIntegral(), and GrainBoundaryArea().

const unsigned int GrainBoundaryArea::_op_num
protected

Number of order parameters.

Definition at line 32 of file GrainBoundaryArea.h.

Referenced by GrainBoundaryArea().


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