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 23 of file GrainBoundaryArea.h.

Constructor & Destructor Documentation

◆ GrainBoundaryArea()

GrainBoundaryArea::GrainBoundaryArea ( const InputParameters &  parameters)

Definition at line 36 of file GrainBoundaryArea.C.

37  : ElementIntegralPostprocessor(parameters),
38  _op_num(coupledComponents("v")),
39  _grads(_op_num),
40  _factor(getParam<Real>("grains_per_side") * getParam<Real>("op_range"))
41 {
42  // make sure user input is valid
43  if (MooseUtils::absoluteFuzzyEqual(_factor, 0.0))
44  mooseError("Neither grains_per_side nor op_range may be zero.");
45 
46  // Loop over variables (ops)
47  for (auto op_index = decltype(_op_num)(0); op_index < _op_num; ++op_index)
48  _grads[op_index] = &coupledGradient("v", op_index);
49 }
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

◆ computeQpIntegral()

Real GrainBoundaryArea::computeQpIntegral ( )
overrideprotectedvirtual

Definition at line 52 of file GrainBoundaryArea.C.

53 {
54  Real grad_sum = 0.0;
55  for (auto grad : _grads)
56  grad_sum += (*grad)[_qp].norm();
57  return grad_sum;
58 }
std::vector< const VariableGradient * > _grads
Order parameters.

◆ getValue()

Real GrainBoundaryArea::getValue ( )
overridevirtual

Definition at line 61 of file GrainBoundaryArea.C.

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

Member Data Documentation

◆ _factor

const Real GrainBoundaryArea::_factor
protected

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

Definition at line 40 of file GrainBoundaryArea.h.

Referenced by getValue(), and GrainBoundaryArea().

◆ _grads

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

Order parameters.

Definition at line 37 of file GrainBoundaryArea.h.

Referenced by computeQpIntegral(), and GrainBoundaryArea().

◆ _op_num

const unsigned int GrainBoundaryArea::_op_num
protected

Number of order parameters.

Definition at line 34 of file GrainBoundaryArea.h.

Referenced by GrainBoundaryArea().


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