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

This class is here to get the force and torque acting on a grain. More...

#include <ConstantGrainForceAndTorque.h>

Inheritance diagram for ConstantGrainForceAndTorque:
[legend]

Public Member Functions

 ConstantGrainForceAndTorque (const InputParameters &parameters)
 
virtual void initialize ()
 
virtual void execute ()
 
virtual void finalize ()
 
virtual const std::vector< RealGradient > & getForceValues () const
 
virtual const std::vector< RealGradient > & getTorqueValues () const
 
virtual const std::vector< Real > & getForceCJacobians () const
 
virtual const std::vector< std::vector< Real > > & getForceEtaJacobians () const
 

Protected Attributes

std::vector< Real > _F
 Applied force on particles, size should be 3 times no. of grains. More...
 
std::vector< Real > _M
 Applied torque on particles, size should be 3 times no. of grains. More...
 
unsigned int _grain_num
 
unsigned int _ncomp
 
std::vector< RealGradient > _force_values
 providing grain forces, torques and their jacobians w. r. t c More...
 
std::vector< RealGradient > _torque_values
 
std::vector< Real > _c_jacobians
 
std::vector< std::vector< Real > > _eta_jacobians
 

Detailed Description

This class is here to get the force and torque acting on a grain.

Definition at line 22 of file ConstantGrainForceAndTorque.h.

Constructor & Destructor Documentation

ConstantGrainForceAndTorque::ConstantGrainForceAndTorque ( const InputParameters &  parameters)

Definition at line 21 of file ConstantGrainForceAndTorque.C.

23  GeneralUserObject(parameters),
24  _F(getParam<std::vector<Real>>("force")),
25  _M(getParam<std::vector<Real>>("torque")),
26  _grain_num(_F.size() / 3),
27  _ncomp(6 * _grain_num),
30 {
31 }
std::vector< Real > _M
Applied torque on particles, size should be 3 times no. of grains.
This class provides interface for extracting the forces and torques computed in other UserObjects...
std::vector< Real > _F
Applied force on particles, size should be 3 times no. of grains.
std::vector< RealGradient > _torque_values
std::vector< RealGradient > _force_values
providing grain forces, torques and their jacobians w. r. t c

Member Function Documentation

virtual void ConstantGrainForceAndTorque::execute ( )
inlinevirtual

Definition at line 28 of file ConstantGrainForceAndTorque.h.

28 {}
virtual void ConstantGrainForceAndTorque::finalize ( )
inlinevirtual

Definition at line 29 of file ConstantGrainForceAndTorque.h.

29 {}
const std::vector< Real > & ConstantGrainForceAndTorque::getForceCJacobians ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 69 of file ConstantGrainForceAndTorque.C.

Referenced by finalize().

70 {
71  return _c_jacobians;
72 }
const std::vector< std::vector< Real > > & ConstantGrainForceAndTorque::getForceEtaJacobians ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 75 of file ConstantGrainForceAndTorque.C.

Referenced by finalize().

76 {
77  return _eta_jacobians;
78 }
std::vector< std::vector< Real > > _eta_jacobians
const std::vector< RealGradient > & ConstantGrainForceAndTorque::getForceValues ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 57 of file ConstantGrainForceAndTorque.C.

Referenced by finalize().

58 {
59  return _force_values;
60 }
std::vector< RealGradient > _force_values
providing grain forces, torques and their jacobians w. r. t c
const std::vector< RealGradient > & ConstantGrainForceAndTorque::getTorqueValues ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 63 of file ConstantGrainForceAndTorque.C.

Referenced by finalize().

64 {
65  return _torque_values;
66 }
std::vector< RealGradient > _torque_values
void ConstantGrainForceAndTorque::initialize ( )
virtual

Definition at line 34 of file ConstantGrainForceAndTorque.C.

35 {
36  unsigned int total_dofs = _subproblem.es().n_dofs();
37  for (unsigned int i = 0; i < _grain_num; ++i)
38  {
39  _force_values[i](0) = _F[3 * i + 0];
40  _force_values[i](1) = _F[3 * i + 1];
41  _force_values[i](2) = _F[3 * i + 2];
42  _torque_values[i](0) = _M[3 * i + 0];
43  _torque_values[i](1) = _M[3 * i + 1];
44  _torque_values[i](2) = _M[3 * i + 2];
45  }
46 
47  if (_fe_problem.currentlyComputingJacobian())
48  {
49  _c_jacobians.assign(6 * _grain_num * total_dofs, 0.0);
50  _eta_jacobians.resize(_grain_num);
51  for (unsigned int i = 0; i < _grain_num; ++i)
52  _eta_jacobians[i].assign(6 * _grain_num * total_dofs, 0.0);
53  }
54 }
std::vector< Real > _M
Applied torque on particles, size should be 3 times no. of grains.
std::vector< Real > _F
Applied force on particles, size should be 3 times no. of grains.
std::vector< RealGradient > _torque_values
std::vector< std::vector< Real > > _eta_jacobians
std::vector< RealGradient > _force_values
providing grain forces, torques and their jacobians w. r. t c

Member Data Documentation

std::vector<Real> ConstantGrainForceAndTorque::_c_jacobians
protected

Definition at line 48 of file ConstantGrainForceAndTorque.h.

Referenced by getForceCJacobians(), and initialize().

std::vector<std::vector<Real> > ConstantGrainForceAndTorque::_eta_jacobians
protected

Definition at line 49 of file ConstantGrainForceAndTorque.h.

Referenced by getForceEtaJacobians(), and initialize().

std::vector<Real> ConstantGrainForceAndTorque::_F
protected

Applied force on particles, size should be 3 times no. of grains.

Definition at line 38 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

std::vector<RealGradient> ConstantGrainForceAndTorque::_force_values
protected

providing grain forces, torques and their jacobians w. r. t c

Definition at line 46 of file ConstantGrainForceAndTorque.h.

Referenced by getForceValues(), and initialize().

unsigned int ConstantGrainForceAndTorque::_grain_num
protected

Definition at line 42 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

std::vector<Real> ConstantGrainForceAndTorque::_M
protected

Applied torque on particles, size should be 3 times no. of grains.

Definition at line 40 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

unsigned int ConstantGrainForceAndTorque::_ncomp
protected

Definition at line 43 of file ConstantGrainForceAndTorque.h.

std::vector<RealGradient> ConstantGrainForceAndTorque::_torque_values
protected

Definition at line 47 of file ConstantGrainForceAndTorque.h.

Referenced by getTorqueValues(), and initialize().


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