www.mooseframework.org
GrainCentersPostprocessor.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<VectorPostprocessor>();
15  params.addClassDescription("Outputs the values from GrainCentersPostprocessor");
16  params.addParam<UserObjectName>(
17  "grain_data", "Specify user object that gives center of mass and volume of grains");
18  return params;
19 }
20 
21 GrainCentersPostprocessor::GrainCentersPostprocessor(const InputParameters & parameters)
22  : GeneralVectorPostprocessor(parameters),
23  _grain_volume_center_vector(declareVector("grain_volume_center_vector")),
24  _grain_data(getUserObject<ComputeGrainCenterUserObject>("grain_data")),
25  _grain_volumes(_grain_data.getGrainVolumes()),
26  _grain_centers(_grain_data.getGrainCenters()),
27  _total_grains(_grain_volumes.size())
28 {
30 }
31 
32 void
34 {
35  for (unsigned int i = 0; i < _total_grains; ++i)
36  {
40  _grain_volume_center_vector[4 * i + 3] = _grain_centers[i](2);
41  }
42 }
InputParameters validParams< GrainCentersPostprocessor >()
This UserObject computes a volumes and centers of grains.
GrainCentersPostprocessor(const InputParameters &parameters)
const std::vector< Point > & _grain_centers
Extracting grain centers from Userobject.
const std::vector< Real > & _grain_volumes
Extracting grain volumes from Userobject.
VectorPostprocessorValue & _grain_volume_center_vector
The VectorPostprocessorValue object where the results are stored.