www.mooseframework.org
ComputeMaterialsObjectThread.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef COMPUTERESIDUALTHREAD_H
16 #define COMPUTERESIDUALTHREAD_H
17 
18 #include "ThreadedElementLoop.h"
19 
20 #include "libmesh/elem_range.h"
21 
22 // Forward declarations
23 class FEProblemBase;
26 class MaterialData;
27 class Assembly;
28 
29 class ComputeMaterialsObjectThread : public ThreadedElementLoop<ConstElemRange>
30 {
31 public:
33  std::vector<std::shared_ptr<MaterialData>> & material_data,
34  std::vector<std::shared_ptr<MaterialData>> & bnd_material_data,
35  std::vector<std::shared_ptr<MaterialData>> & neighbor_material_data,
36  MaterialPropertyStorage & material_props,
37  MaterialPropertyStorage & bnd_material_props,
38  std::vector<Assembly *> & assembly);
39 
40  // Splitting Constructor
42 
44 
45  virtual void post() override;
46  virtual void subdomainChanged() override;
47  virtual void onElement(const Elem * elem) override;
48  virtual void onBoundary(const Elem * elem, unsigned int side, BoundaryID bnd_id) override;
49  virtual void onInternalSide(const Elem * elem, unsigned int side) override;
50 
51  void join(const ComputeMaterialsObjectThread & /*y*/);
52 
53 protected:
56  std::vector<std::shared_ptr<MaterialData>> & _material_data;
57  std::vector<std::shared_ptr<MaterialData>> & _bnd_material_data;
58  std::vector<std::shared_ptr<MaterialData>> & _neighbor_material_data;
61 
65 
66  std::vector<Assembly *> & _assembly;
68 
69  const bool _has_stateful_props;
71 };
72 
73 #endif // COMPUTERESIDUALTHREAD_H
std::vector< std::shared_ptr< MaterialData > > & _neighbor_material_data
Base class for assembly-like calculations.
std::vector< std::shared_ptr< MaterialData > > & _material_data
void join(const ComputeMaterialsObjectThread &)
Keeps track of stuff related to assembling.
Definition: Assembly.h:63
MaterialPropertyStorage & _material_props
Stores the stateful material properties computed by materials.
virtual void onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id) override
Called when doing boundary assembling.
Material objects are special in that they have additional objects created automatically (see FEProble...
static PetscErrorCode Vec x
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Nonlinear system to be solved.
std::vector< std::shared_ptr< MaterialData > > & _bnd_material_data
const MaterialWarehouse & _materials
Reference to the Material object warehouses.
virtual void onInternalSide(const Elem *elem, unsigned int side) override
Called when doing internal edge assembling.
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
Proxy for accessing MaterialPropertyStorage.
Definition: MaterialData.h:33
virtual void post() override
Called after the element range loop.
MaterialPropertyStorage & _bnd_material_props
const MaterialWarehouse & _discrete_materials
boundary_id_type BoundaryID
Definition: MooseTypes.h:75
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, std::vector< Assembly * > &assembly)
std::vector< Assembly * > & _assembly