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

Constructor & Destructor Documentation

GrainForcesPostprocessor::GrainForcesPostprocessor ( const InputParameters &  parameters)

Definition at line 21 of file GrainForcesPostprocessor.C.

22  : GeneralVectorPostprocessor(parameters),
23  _grain_force_torque_vector(declareVector("grain_force_torque_vector")),
24  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
27  _grain_num(0)
28 {
29 }
const GrainForceAndTorqueInterface & _grain_force_torque
UserobjectInterface for getting force and torque values from UserObjects.
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 > & getTorqueValues() const =0
VectorPostprocessorValue & _grain_force_torque_vector
The VectorPostprocessorValue object where the results are stored.
virtual const std::vector< RealGradient > & getForceValues() const =0
virtual GrainForcesPostprocessor::~GrainForcesPostprocessor ( )
inlinevirtual

Definition at line 28 of file GrainForcesPostprocessor.h.

28 {}

Member Function Documentation

void GrainForcesPostprocessor::execute ( )
virtual

Definition at line 42 of file GrainForcesPostprocessor.C.

Referenced by ~GrainForcesPostprocessor().

43 {
44  for (unsigned int i = 0; i < _grain_num; ++i)
45  {
46  _grain_force_torque_vector[6 * i + 0] = _grain_forces[i](0);
47  _grain_force_torque_vector[6 * i + 1] = _grain_forces[i](1);
48  _grain_force_torque_vector[6 * i + 2] = _grain_forces[i](2);
49  _grain_force_torque_vector[6 * i + 3] = _grain_torques[i](0);
50  _grain_force_torque_vector[6 * i + 4] = _grain_torques[i](1);
51  _grain_force_torque_vector[6 * i + 5] = _grain_torques[i](2);
52  }
53 }
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.
void GrainForcesPostprocessor::initialize ( )
virtual

Definition at line 32 of file GrainForcesPostprocessor.C.

Referenced by ~GrainForcesPostprocessor().

33 {
34  _grain_num = _grain_forces.size();
35 
36  // for each grain a force and a torque vector with 3 components each are serialized into the
37  // output vector
38  _grain_force_torque_vector.resize(_grain_num * 2 * 3);
39 }
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

const GrainForceAndTorqueInterface& GrainForcesPostprocessor::_grain_force_torque
protected

UserobjectInterface for getting force and torque values from UserObjects.

Definition at line 37 of file GrainForcesPostprocessor.h.

VectorPostprocessorValue& GrainForcesPostprocessor::_grain_force_torque_vector
protected

The VectorPostprocessorValue object where the results are stored.

Definition at line 34 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

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

Extracting forces from Userobject.

Definition at line 39 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

unsigned int GrainForcesPostprocessor::_grain_num
protected

total no. of grains

Definition at line 43 of file GrainForcesPostprocessor.h.

Referenced by execute(), and initialize().

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

Extracting torques from Userobject.

Definition at line 41 of file GrainForcesPostprocessor.h.

Referenced by execute().


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