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 25 of file ConstantGrainForceAndTorque.h.

Constructor & Destructor Documentation

◆ ConstantGrainForceAndTorque()

ConstantGrainForceAndTorque::ConstantGrainForceAndTorque ( const InputParameters &  parameters)

Definition at line 25 of file ConstantGrainForceAndTorque.C.

27  GeneralUserObject(parameters),
28  _F(getParam<std::vector<Real>>("force")),
29  _M(getParam<std::vector<Real>>("torque")),
30  _grain_num(_F.size() / 3),
31  _ncomp(6 * _grain_num),
34 {
35 }
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

◆ execute()

virtual void ConstantGrainForceAndTorque::execute ( )
inlinevirtual

Definition at line 31 of file ConstantGrainForceAndTorque.h.

31 {}

◆ finalize()

virtual void ConstantGrainForceAndTorque::finalize ( )
inlinevirtual

Definition at line 32 of file ConstantGrainForceAndTorque.h.

32 {}

◆ getForceCJacobians()

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

Implements GrainForceAndTorqueInterface.

Definition at line 73 of file ConstantGrainForceAndTorque.C.

74 {
75  return _c_jacobians;
76 }

◆ getForceEtaJacobians()

const std::vector< std::vector< Real > > & ConstantGrainForceAndTorque::getForceEtaJacobians ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 79 of file ConstantGrainForceAndTorque.C.

80 {
81  return _eta_jacobians;
82 }
std::vector< std::vector< Real > > _eta_jacobians

◆ getForceValues()

const std::vector< RealGradient > & ConstantGrainForceAndTorque::getForceValues ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 61 of file ConstantGrainForceAndTorque.C.

62 {
63  return _force_values;
64 }
std::vector< RealGradient > _force_values
providing grain forces, torques and their jacobians w. r. t c

◆ getTorqueValues()

const std::vector< RealGradient > & ConstantGrainForceAndTorque::getTorqueValues ( ) const
virtual

Implements GrainForceAndTorqueInterface.

Definition at line 67 of file ConstantGrainForceAndTorque.C.

68 {
69  return _torque_values;
70 }
std::vector< RealGradient > _torque_values

◆ initialize()

void ConstantGrainForceAndTorque::initialize ( )
virtual

Definition at line 38 of file ConstantGrainForceAndTorque.C.

39 {
40  unsigned int total_dofs = _subproblem.es().n_dofs();
41  for (unsigned int i = 0; i < _grain_num; ++i)
42  {
43  _force_values[i](0) = _F[3 * i + 0];
44  _force_values[i](1) = _F[3 * i + 1];
45  _force_values[i](2) = _F[3 * i + 2];
46  _torque_values[i](0) = _M[3 * i + 0];
47  _torque_values[i](1) = _M[3 * i + 1];
48  _torque_values[i](2) = _M[3 * i + 2];
49  }
50 
51  if (_fe_problem.currentlyComputingJacobian())
52  {
53  _c_jacobians.assign(6 * _grain_num * total_dofs, 0.0);
54  _eta_jacobians.resize(_grain_num);
55  for (unsigned int i = 0; i < _grain_num; ++i)
56  _eta_jacobians[i].assign(6 * _grain_num * total_dofs, 0.0);
57  }
58 }
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

◆ _c_jacobians

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

Definition at line 51 of file ConstantGrainForceAndTorque.h.

Referenced by getForceCJacobians(), and initialize().

◆ _eta_jacobians

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

Definition at line 52 of file ConstantGrainForceAndTorque.h.

Referenced by getForceEtaJacobians(), and initialize().

◆ _F

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

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

Definition at line 41 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

◆ _force_values

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

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

Definition at line 49 of file ConstantGrainForceAndTorque.h.

Referenced by getForceValues(), and initialize().

◆ _grain_num

unsigned int ConstantGrainForceAndTorque::_grain_num
protected

Definition at line 45 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

◆ _M

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

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

Definition at line 43 of file ConstantGrainForceAndTorque.h.

Referenced by initialize().

◆ _ncomp

unsigned int ConstantGrainForceAndTorque::_ncomp
protected

Definition at line 46 of file ConstantGrainForceAndTorque.h.

◆ _torque_values

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

Definition at line 50 of file ConstantGrainForceAndTorque.h.

Referenced by getTorqueValues(), and initialize().


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