https://mooseframework.inl.gov
ProjectMaterialProperties.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 "ThreadedElementLoop.h"
14 
15 #include "libmesh/elem_range.h"
16 
17 class FEProblemBase;
20 class MaterialData;
21 class Assembly;
22 
23 class ProjectMaterialProperties : public ThreadedElementLoop<ConstElemPointerRange>
24 {
25 public:
26  ProjectMaterialProperties(bool refine,
27  FEProblemBase & fe_problem,
28  MaterialPropertyStorage & material_props,
29  MaterialPropertyStorage & bnd_material_props,
30  std::vector<std::vector<std::unique_ptr<Assembly>>> & assembly);
31 
32  // Splitting Constructor
34 
36 
37  virtual void subdomainChanged() override;
38  virtual void onElement(const Elem * elem) override;
39  virtual void onBoundary(const Elem * elem,
40  unsigned int side,
41  BoundaryID bnd_id,
42  const Elem * lower_d_elem = nullptr) override;
43  virtual void onInternalSide(const Elem * elem, unsigned int side) override;
44 
45  void join(const ProjectMaterialProperties & /*y*/);
46 
47 protected:
49  bool _refine;
53  std::vector<std::vector<std::unique_ptr<Assembly>>> & _assembly;
55 
60 
61 private:
62  bool shouldComputeInternalSide(const Elem & /*elem*/, const Elem & /*neighbor*/) const override;
63 };
64 
65 inline bool
67  const Elem & /*neighbor*/) const
68 {
69  return true;
70 }
Base class for assembly-like calculations.
ProjectMaterialProperties(bool refine, FEProblemBase &fe_problem, MaterialPropertyStorage &material_props, MaterialPropertyStorage &bnd_material_props, std::vector< std::vector< std::unique_ptr< Assembly >>> &assembly)
Keeps track of stuff related to assembling.
Definition: Assembly.h:101
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
Stores the stateful material properties computed by materials.
MaterialPropertyStorage & _bnd_material_props
const MaterialWarehouse & _discrete_materials
Discrete materials warehouse.
bool shouldComputeInternalSide(const Elem &, const Elem &) const override
Whether to compute the internal side for the provided element-neighbor pair.
MaterialBase objects are special in that they have additional objects created automatically (see FEPr...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
Nonlinear system to be solved.
bool _refine
Whether or not you are projecting refinements. Set to false for coarsening.
const MaterialWarehouse & _materials
Materials warehouse.
MaterialPropertyStorage & _material_props
boundary_id_type BoundaryID
virtual void onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id, const Elem *lower_d_elem=nullptr) override
Called when doing boundary assembling.
tbb::split split
Proxy for accessing MaterialPropertyStorage.
Definition: MaterialData.h:33
void join(const ProjectMaterialProperties &)
virtual void onInternalSide(const Elem *elem, unsigned int side) override
Called when doing internal edge assembling.
std::vector< std::vector< std::unique_ptr< Assembly > > > & _assembly