https://mooseframework.inl.gov
ProjectedStatefulMaterialNodalPatchRecovery.h
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 
10 #pragma once
11 
12 // MOOSE includes
13 #include "ElementUserObject.h"
14 #include "SerialAccess.h"
15 
16 #include <unordered_map>
17 
19 {
20 public:
22 
25  {
26  }
27 
28  virtual Real nodalPatchRecovery(const Point & p,
29  const std::vector<dof_id_type> & elem_ids,
30  std::size_t component) const = 0;
31 };
32 
33 template <typename T, bool is_ad>
36 {
37 public:
39 
41 
51  virtual Real nodalPatchRecovery(const Point & p,
52  const std::vector<dof_id_type> & elem_ids,
53  std::size_t component) const override;
54 
55  virtual void initialSetup() override;
56 
57  virtual void initialize() override;
58  virtual void execute() override;
59  virtual void threadJoin(const UserObject &) override;
60  virtual void finalize() override;
61 
62 private:
75  RealEigenVector evaluateBasisFunctions(const Point & q_point) const;
76 
78  typedef std::pair<RealEigenMatrix, std::vector<RealEigenVector>> ElementData;
79 
81  unsigned int _qp;
82 
84  std::size_t _n_components;
85 
87  const unsigned int _patch_polynomial_order;
88 
90  const std::vector<std::vector<unsigned int>> _multi_index;
91 
93  const unsigned int _q;
94 
97 
99  std::unordered_map<dof_id_type, ElementData> _abs;
100 
103 
105  std::unordered_map<SubdomainID, std::vector<MaterialBase *>> _required_materials;
106 };
107 
124 
125 // Prevent implicit instantiation in other translation units where these classes are used
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
ProjectedStatefulMaterialNodalPatchRecoveryTempl< Real, true > ADProjectedStatefulMaterialNodalPatchRecoveryReal
ProjectedStatefulMaterialNodalPatchRecoveryTempl< Real, false > ProjectedStatefulMaterialNodalPatchRecoveryReal
const std::vector< std::vector< unsigned int > > _multi_index
The multi-index table.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real nodalPatchRecovery(const Point &p, const std::vector< dof_id_type > &elem_ids, std::size_t component) const override
Solve the least-squares problem.
RealEigenVector evaluateBasisFunctions(const Point &q_point) const
Compute the P vector at a given point i.e.
const GenericMaterialProperty< T, is_ad > & _prop
stored property
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankFourTensor, true > ADProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor
virtual void threadJoin(const UserObject &) override
Must override.
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankTwoTensor, true > ADProjectedStatefulMaterialNodalPatchRecoveryRankTwoTensor
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
std::size_t _n_components
number of scalar components in the recovered type
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankFourTensor, false > ProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor
std::pair< RealEigenMatrix, std::vector< RealEigenVector > > ElementData
data type stored for each element
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RealVectorValue, false > ProjectedStatefulMaterialNodalPatchRecoveryRealVectorValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > _required_materials
list of required materials that need to be explicitly initialized at step zero
virtual Real nodalPatchRecovery(const Point &p, const std::vector< dof_id_type > &elem_ids, std::size_t component) const =0
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
std::unordered_map< dof_id_type, ElementData > _abs
The element-level A matrix and the element-level b vectors for each component.
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RealVectorValue, true > ADProjectedStatefulMaterialNodalPatchRecoveryRealVectorValue
const unsigned int _patch_polynomial_order
The polynomial order, default is variable order.
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankTwoTensor, false > ProjectedStatefulMaterialNodalPatchRecoveryRankTwoTensor
Base class for user-specific data.
Definition: UserObject.h:40