Line data Source code
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; 18 : class NonlinearSystemBase; 19 : class MaterialPropertyStorage; 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 33 : ProjectMaterialProperties(ProjectMaterialProperties & x, Threads::split split); 34 : 35 : virtual ~ProjectMaterialProperties(); 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: 48 : /// Whether or not you are projecting refinements. Set to false for coarsening. 49 : bool _refine; 50 : FEProblemBase & _fe_problem; 51 : MaterialPropertyStorage & _material_props; 52 : MaterialPropertyStorage & _bnd_material_props; 53 : std::vector<std::vector<std::unique_ptr<Assembly>>> & _assembly; 54 : bool _need_internal_side_material; 55 : 56 : /// Materials warehouse 57 : const MaterialWarehouse & _materials; 58 : /// Discrete materials warehouse 59 : const MaterialWarehouse & _discrete_materials; 60 : 61 : private: 62 : bool shouldComputeInternalSide(const Elem & /*elem*/, const Elem & /*neighbor*/) const override; 63 : }; 64 : 65 : inline bool 66 21860 : ProjectMaterialProperties::shouldComputeInternalSide(const Elem & /*elem*/, 67 : const Elem & /*neighbor*/) const 68 : { 69 21860 : return true; 70 : }