https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GrainForcesPostprocessor.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
12
14
17{
19 params.addClassDescription("Outputs the values from GrainForcesPostprocessor");
20 params.addParam<UserObjectName>(
21 "grain_force", "Specify userobject that gives center of mass and volume of grains");
22 return params;
23}
24
26 : GeneralVectorPostprocessor(parameters),
27 _grain_force_torque_vector(declareVector("grain_force_torque_vector")),
28 _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
29 _grain_forces(_grain_force_torque.getForceValues()),
30 _grain_torques(_grain_force_torque.getTorqueValues()),
31 _grain_num(0)
32{
33}
34
35void
37{
39
40 // for each grain a force and a torque vector with 3 components each are serialized into the
41 // output vector
43}
44
45void
47{
48 for (unsigned int i = 0; i < _grain_num; ++i)
49 {
56 }
57}
registerMooseObject("PhaseFieldApp", GrainForcesPostprocessor)
static InputParameters validParams()
This class provides interface for extracting the forces and torques computed in other UserObjects.
GrainForcesPostprocessor is a type of VectorPostprocessor that outputs the force and torque values ca...
unsigned int _grain_num
total no. of grains
const std::vector< RealGradient > & _grain_forces
Extracting forces from Userobject.
const std::vector< RealGradient > & _grain_torques
Extracting torques from Userobject.
VectorPostprocessorValue & _grain_force_torque_vector
The VectorPostprocessorValue object where the results are stored.
GrainForcesPostprocessor(const InputParameters &parameters)
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)