www.mooseframework.org
MaterialWarehouse.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
11 #include "MaterialWarehouse.h"
12 #include "MaterialBase.h"
13 
14 void
15 MaterialWarehouse::addObjects(std::shared_ptr<MaterialBase> block,
16  std::shared_ptr<MaterialBase> neighbor,
17  std::shared_ptr<MaterialBase> face,
18  THREAD_ID tid /*=0*/)
19 {
21  _neighbor_materials.addObject(neighbor, tid);
22  _face_materials.addObject(face, tid);
23 }
24 
27 {
28  switch (data_type)
29  {
31  return _neighbor_materials;
32 
34  return _face_materials;
35 
36  default:
37  return *this;
38  }
39 }
40 
41 void
43 {
47 }
48 
49 void
51 {
55 }
56 
57 void
59 {
62 }
63 
64 void
66 {
68 }
69 
70 void
72 {
75 }
76 
77 void
79 {
81 }
82 
83 void
85 {
89 }
90 
91 void
93 {
97 }
98 
99 void
101 {
105 }
106 
107 void
109 {
110  checkThreadID(tid);
111 
112  for (auto & object_pair : _all_block_objects[tid])
113  sortHelper(object_pair.second);
114  for (auto & object_pair : _all_boundary_objects[tid])
115  sortHelper(object_pair.second);
116 
117  for (auto & object_pair : _neighbor_materials._all_block_objects[tid])
118  sortHelper(object_pair.second);
119  for (auto & object_pair : _neighbor_materials._all_boundary_objects[tid])
120  sortHelper(object_pair.second);
121 
122  for (auto & object_pair : _face_materials._all_block_objects[tid])
123  sortHelper(object_pair.second);
124  for (auto & object_pair : _face_materials._all_boundary_objects[tid])
125  sortHelper(object_pair.second);
126 
127  updateActive(tid);
128 }
virtual void residualSetup(THREAD_ID tid=0) const
MooseObjectWarehouse< MaterialBase > _neighbor_materials
Storage for neighbor material objects (Block are stored in the base class)
const MooseObjectWarehouse< MaterialBase > & operator[](Moose::MaterialDataType data_type) const
MPI_Datatype data_type
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase > > > > _all_block_objects
virtual void neighborSubdomainSetup(THREAD_ID tid=0) const
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:604
MooseObjectWarehouse< MaterialBase > _face_materials
Storage for face material objects (Block are stored in the base class)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void jacobianSetup(THREAD_ID tid=0) const
void addObjects(std::shared_ptr< MaterialBase > block, std::shared_ptr< MaterialBase > neighbor, std::shared_ptr< MaterialBase > face, THREAD_ID tid=0)
A special method unique to this class for adding Block, Neighbor, and Face material objects...
static void sortHelper(std::vector< std::shared_ptr< MaterialBase >> &objects)
Helper method for sorting vectors of objects.
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void updateActive(THREAD_ID tid=0)
Update the active status of Kernels.
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< MaterialBase > > > > _all_boundary_objects
virtual void jacobianSetup(THREAD_ID tid=0) const
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods that handle the extra neighbor and face objects...
void sort(THREAD_ID tid=0)
virtual void subdomainSetup(THREAD_ID tid=0) const
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
virtual void subdomainSetup(THREAD_ID tid=0) const
unsigned int THREAD_ID
Definition: MooseTypes.h:198
virtual void residualSetup(THREAD_ID tid=0) const