https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
20public:
22
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
33template <typename T, bool is_ad>
36{
37public:
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
62private:
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
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankTwoTensor, true > ADProjectedStatefulMaterialNodalPatchRecoveryRankTwoTensor
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankFourTensor, true > ADProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor
ProjectedStatefulMaterialNodalPatchRecoveryTempl< Real, false > ProjectedStatefulMaterialNodalPatchRecoveryReal
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RealVectorValue, false > ProjectedStatefulMaterialNodalPatchRecoveryRealVectorValue
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankFourTensor, false > ProjectedStatefulMaterialNodalPatchRecoveryRankFourTensor
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RealVectorValue, true > ADProjectedStatefulMaterialNodalPatchRecoveryRealVectorValue
ProjectedStatefulMaterialNodalPatchRecoveryTempl< RankTwoTensor, false > ProjectedStatefulMaterialNodalPatchRecoveryRankTwoTensor
ProjectedStatefulMaterialNodalPatchRecoveryTempl< Real, true > ADProjectedStatefulMaterialNodalPatchRecoveryReal
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
virtual Real nodalPatchRecovery(const Point &p, const std::vector< dof_id_type > &elem_ids, std::size_t component) const =0
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.
const unsigned int _patch_polynomial_order
The polynomial order, default is variable order.
std::unordered_map< dof_id_type, ElementData > _abs
The element-level A matrix and the element-level b vectors for each component.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
std::size_t _n_components
number of scalar components in the recovered type
const std::vector< std::vector< unsigned int > > _multi_index
The multi-index table.
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > _required_materials
list of required materials that need to be explicitly initialized at step zero
virtual void threadJoin(const UserObject &) override
Must override.
const GenericMaterialProperty< T, is_ad > & _prop
stored property
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
RealEigenVector evaluateBasisFunctions(const Point &q_point) const
Compute the P vector at a given point i.e.
std::pair< RealEigenMatrix, std::vector< RealEigenVector > > ElementData
data type stored for each element
Base class for user-specific data.
Definition UserObject.h:20