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

GrainForcesPostprocessor is a type of VectorPostprocessor that outputs the force and torque values calculated in UserObjects. More...

#include <GrainForcesPostprocessor.h>

Inheritance diagram for GrainForcesPostprocessor:
[legend]

Public Member Functions

 GrainForcesPostprocessor (const InputParameters &parameters)
 
virtual ~GrainForcesPostprocessor ()
 
virtual void initialize ()
 
virtual void execute ()
 

Protected Attributes

VectorPostprocessorValue & _grain_force_torque_vector
 The VectorPostprocessorValue object where the results are stored. More...
 
const GrainForceAndTorqueInterface_grain_force_torque
 UserobjectInterface for getting force and torque values from UserObjects. More...
 
const std::vector< RealGradient > & _grain_forces
 Extracting forces from Userobject. More...
 
const std::vector< RealGradient > & _grain_torques
 Extracting torques from Userobject. More...
 
unsigned int _grain_num
 total no. of grains More...
 

Detailed Description

GrainForcesPostprocessor is a type of VectorPostprocessor that outputs the force and torque values calculated in UserObjects.

Definition at line 26 of file GrainForcesPostprocessor.h.

Constructor & Destructor Documentation

◆ GrainForcesPostprocessor()

GrainForcesPostprocessor::GrainForcesPostprocessor ( const InputParameters &  parameters)

Definition at line 26 of file GrainForcesPostprocessor.C.

27  : GeneralVectorPostprocessor(parameters),
28  _grain_force_torque_vector(declareVector("grain_force_torque_vector")),
29  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
32  _grain_num(0)
33 {
34 }
const GrainForceAndTorqueInterface & _grain_force_torque
UserobjectInterface for getting force and torque values from UserObjects.
virtual const std::vector< RealGradient > & getTorqueValues() const =0
const std::vector< RealGradient > & _grain_forces
Extracting forces from Userobject.
const std::vector< RealGradient > & _grain_torques
Extracting torques from Userobject.
unsigned int _grain_num
total no. of grains
virtual const std::vector< RealGradient > & getForceValues() const =0
VectorPostprocessorValue & _grain_force_torque_vector
The VectorPostprocessorValue object where the results are stored.

◆ ~GrainForcesPostprocessor()

virtual GrainForcesPostprocessor::~GrainForcesPostprocessor ( )
inlinevirtual

Definition at line 31 of file GrainForcesPostprocessor.h.

31 {}

Member Function Documentation

◆ execute()

void GrainForcesPostprocessor::execute ( )
virtual

Definition at line 47 of file GrainForcesPostprocessor.C.

48 {
49  for (unsigned int i = 0; i < _grain_num; ++i)
50  {
51  _grain_force_torque_vector[6 * i + 0] = _grain_forces[i](0);
52  _grain_force_torque_vector[6 * i + 1] = _grain_forces[i](1);
53  _grain_force_torque_vector[6 * i + 2] = _grain_forces[i](2);
54  _grain_force_torque_vector[6 * i + 3] = _grain_torques[i](0);
55  _grain_force_torque_vector[6 * i + 4] = _grain_torques[i](1);
56  _grain_force_torque_vector[6 * i + 5] = _grain_torques[i](2);
57  }
58 }
const std::vector< RealGradient > & _grain_forces
Extracting forces from Userobject.
const std::vector< RealGradient > & _grain_torques
Extracting torques from Userobject.
unsigned int _grain_num
total no. of grains
VectorPostprocessorValue & _grain_force_torque_vector
The VectorPostprocessorValue object where the results are stored.

◆ initialize()

void GrainForcesPostprocessor::initialize ( )
virtual

Definition at line 37 of file GrainForcesPostprocessor.C.

38 {
39  _grain_num = _grain_forces.size();
40 
41  // for each grain a force and a torque vector with 3 components each are serialized into the
42  // output vector
43  _grain_force_torque_vector.resize(_grain_num * 2 * 3);
44 }
const std::vector< RealGradient > & _grain_forces
Extracting forces from Userobject.
unsigned int _grain_num
total no. of grains
VectorPostprocessorValue & _grain_force_torque_vector
The VectorPostprocessorValue object where the results are stored.

Member Data Documentation

◆ _grain_force_torque

const GrainForceAndTorqueInterface& GrainForcesPostprocessor::_grain_force_torque
protected

UserobjectInterface for getting force and torque values from UserObjects.

Definition at line 40 of file GrainForcesPostprocessor.h.

◆ _grain_force_torque_vector

VectorPostprocessorValue& GrainForcesPostprocessor::_grain_force_torque_vector
protected

The VectorPostprocessorValue object where the results are stored.

Definition at line 37 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

◆ _grain_forces

const std::vector<RealGradient>& GrainForcesPostprocessor::_grain_forces
protected

Extracting forces from Userobject.

Definition at line 42 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

◆ _grain_num

unsigned int GrainForcesPostprocessor::_grain_num
protected

total no. of grains

Definition at line 46 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

◆ _grain_torques

const std::vector<RealGradient>& GrainForcesPostprocessor::_grain_torques
protected

Extracting torques from Userobject.

Definition at line 44 of file GrainForcesPostprocessor.h.

Referenced by execute().


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