/
ComputeMaterialsObjectThread.h
72 lines (58 loc) · 2.78 KB
/
ComputeMaterialsObjectThread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef COMPUTEMATERIALOBJECTTHREAD_H
#define COMPUTEMATERIALOBJECTTHREAD_H
#include "ThreadedElementLoop.h"
#include "libmesh/elem_range.h"
// Forward declarations
class FEProblemBase;
class NonlinearSystemBase;
class MaterialPropertyStorage;
class MaterialData;
class Assembly;
class ComputeMaterialsObjectThread : public ThreadedElementLoop<ConstElemRange>
{
public:
ComputeMaterialsObjectThread(FEProblemBase & fe_problem,
std::vector<std::shared_ptr<MaterialData>> & material_data,
std::vector<std::shared_ptr<MaterialData>> & bnd_material_data,
std::vector<std::shared_ptr<MaterialData>> & neighbor_material_data,
MaterialPropertyStorage & material_props,
MaterialPropertyStorage & bnd_material_props,
MaterialPropertyStorage & neighbor_material_props,
std::vector<std::unique_ptr<Assembly>> & assembly);
// Splitting Constructor
ComputeMaterialsObjectThread(ComputeMaterialsObjectThread & x, Threads::split split);
virtual void post() override;
virtual void subdomainChanged() override;
virtual void onElement(const Elem * elem) override;
virtual void onBoundary(const Elem * elem, unsigned int side, BoundaryID bnd_id) override;
virtual void onInternalSide(const Elem * elem, unsigned int side) override;
void join(const ComputeMaterialsObjectThread & /*y*/);
protected:
FEProblemBase & _fe_problem;
NonlinearSystemBase & _nl;
std::vector<std::shared_ptr<MaterialData>> & _material_data;
std::vector<std::shared_ptr<MaterialData>> & _bnd_material_data;
std::vector<std::shared_ptr<MaterialData>> & _neighbor_material_data;
MaterialPropertyStorage & _material_props;
MaterialPropertyStorage & _bnd_material_props;
MaterialPropertyStorage & _neighbor_material_props;
/// This is populated using _fe_problem.getResidualMaterialsWarehouse because it has the union
/// of traditional materials and the residual version of AD materials. We don't need the Jacobian
/// version of the ADMaterial for doing stateful stuff
const MaterialWarehouse & _materials;
const MaterialWarehouse & _discrete_materials;
std::vector<std::unique_ptr<Assembly>> & _assembly;
bool _need_internal_side_material;
const bool _has_stateful_props;
const bool _has_bnd_stateful_props;
const bool _has_neighbor_stateful_props;
};
#endif // COMPUTEMATERIALOBJECTTHREAD_H