www.mooseframework.org
GrainRigidBodyMotionBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #pragma once
11 
12 #include "NonlocalKernel.h"
14 
15 // Forward Declarations
18 
19 template <>
21 
22 class GrainRigidBodyMotionBase : public NonlocalKernel
23 
24 {
25 public:
26  GrainRigidBodyMotionBase(const InputParameters & parameters);
27 
28  virtual void timestepSetup();
29 
30 protected:
31  virtual bool globalDoFEnabled(MooseVariableFEBase & /*var*/, dof_id_type /*dof_index*/);
32 
33  virtual void precalculateResidual();
34  virtual void precalculateJacobian();
35  virtual void precalculateOffDiagJacobian(unsigned int jvar);
36 
37  virtual void calculateAdvectionVelocity() {}
38 
40  const std::vector<dof_id_type> & _var_dofs;
41 
43  unsigned int _c_var;
45  const VariableValue & _c;
47  const VariableGradient & _grad_c;
49  const std::vector<dof_id_type> & _c_dofs;
50 
52  const unsigned int _op_num;
54  std::vector<const VariableValue *> _vals;
55  std::vector<unsigned int> _vals_var;
56  std::vector<const VariableGradient *> _grad_vals;
57 
59  std::string _base_name;
60 
63  const std::vector<RealGradient> & _grain_forces;
64  const std::vector<RealGradient> & _grain_torques;
65  const std::vector<Real> & _grain_force_c_jacobians;
66  const std::vector<std::vector<Real>> & _grain_force_eta_jacobians;
67 
69  const Real _mt;
71  const Real _mr;
72 
75 
77  const VectorPostprocessorValue & _grain_volumes;
78 
80  unsigned int _total_dofs;
81 
86  std::vector<unsigned int> _grain_ids;
87 };
88 
virtual void precalculateOffDiagJacobian(unsigned int jvar)
std::string _base_name
base name specifying type of force density material
VectorValue< Real > RealGradient
const unsigned int _op_num
no. of order parameters
GrainRigidBodyMotionBase(const InputParameters &parameters)
This class defines the interface for the GrainTracking objects.
This class provides interface for extracting the forces and torques computed in other UserObjects...
RealGradient _velocity_advection
storing the advection velocity and corresponding jacobian entries calculated in userobjects ...
const std::vector< dof_id_type > & _var_dofs
Variable&#39;s local dof indices.
const Real _mr
constant value corresponding to grain rotation
const VariableGradient & _grad_c
Variable gradient for the concentration.
std::vector< unsigned int > _grain_ids
obtain the active grain ids
const GrainForceAndTorqueInterface & _grain_force_torque
getting userobject for calculating grain forces and torques
const std::vector< std::vector< Real > > & _grain_force_eta_jacobians
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
const std::vector< RealGradient > & _grain_torques
const std::vector< RealGradient > & _grain_forces
std::vector< unsigned int > _vals_var
virtual bool globalDoFEnabled(MooseVariableFEBase &, dof_id_type)
unsigned int _total_dofs
get the total no. of dofs in the system
const VariableValue & _c
Variable value for the concentration.
const GrainTrackerInterface & _grain_tracker
grain tracker object
const std::vector< dof_id_type > & _c_dofs
local dof indices of variable c
unsigned int _c_var
int label for the Concentration
const Real _mt
constant value corresponding to grain translation
std::vector< const VariableValue * > _vals
Variable value for the order parameters.
InputParameters validParams< GrainRigidBodyMotionBase >()
std::vector< const VariableGradient * > _grad_vals
const std::vector< Real > & _grain_force_c_jacobians