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 : // MOOSE includes 11 : #include "MaterialWarehouse.h" 12 : #include "MaterialBase.h" 13 : 14 : void 15 20050 : 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 : { 20 20050 : MooseObjectWarehouse<MaterialBase>::addObject(block, tid); 21 20050 : _neighbor_materials.addObject(neighbor, tid); 22 20050 : _face_materials.addObject(face, tid); 23 20050 : } 24 : 25 : const MooseObjectWarehouse<MaterialBase> & 26 29308753 : MaterialWarehouse::operator[](Moose::MaterialDataType data_type) const 27 : { 28 29308753 : switch (data_type) 29 : { 30 11064040 : case Moose::NEIGHBOR_MATERIAL_DATA: 31 11064040 : return _neighbor_materials; 32 : 33 18242015 : case Moose::FACE_MATERIAL_DATA: 34 18242015 : return _face_materials; 35 : 36 2698 : default: 37 2698 : return *this; 38 : } 39 : } 40 : 41 : void 42 8143 : MaterialWarehouse::initialSetup(THREAD_ID tid /*=0*/) const 43 : { 44 8143 : MooseObjectWarehouse<MaterialBase>::initialSetup(tid); 45 8123 : _neighbor_materials.initialSetup(tid); 46 8123 : _face_materials.initialSetup(tid); 47 8123 : } 48 : 49 : void 50 284311 : MaterialWarehouse::timestepSetup(THREAD_ID tid /*=0*/) const 51 : { 52 284311 : MooseObjectWarehouse<MaterialBase>::timestepSetup(tid); 53 284311 : _neighbor_materials.timestepSetup(tid); 54 284311 : _face_materials.timestepSetup(tid); 55 284311 : } 56 : 57 : void 58 0 : MaterialWarehouse::subdomainSetup(THREAD_ID tid /*=0*/) const 59 : { 60 0 : MooseObjectWarehouse<MaterialBase>::subdomainSetup(tid); 61 0 : _face_materials.subdomainSetup(tid); 62 0 : } 63 : 64 : void 65 0 : MaterialWarehouse::neighborSubdomainSetup(THREAD_ID tid /*=0*/) const 66 : { 67 0 : _neighbor_materials.subdomainSetup(tid); 68 0 : } 69 : 70 : void 71 5401004 : MaterialWarehouse::subdomainSetup(SubdomainID id, THREAD_ID tid /*=0*/) const 72 : { 73 5401004 : MooseObjectWarehouse<MaterialBase>::subdomainSetup(id, tid); 74 5401004 : _face_materials.subdomainSetup(id, tid); 75 5401004 : } 76 : 77 : void 78 16031463 : MaterialWarehouse::neighborSubdomainSetup(SubdomainID id, THREAD_ID tid /*=0*/) const 79 : { 80 16031463 : _neighbor_materials.subdomainSetup(id, tid); 81 16031463 : } 82 : 83 : void 84 3339825 : MaterialWarehouse::residualSetup(THREAD_ID tid /*=0*/) const 85 : { 86 3339825 : MooseObjectWarehouse<MaterialBase>::residualSetup(tid); 87 3339825 : _neighbor_materials.residualSetup(tid); 88 3339825 : _face_materials.residualSetup(tid); 89 3339825 : } 90 : 91 : void 92 524971 : MaterialWarehouse::jacobianSetup(THREAD_ID tid /*=0*/) const 93 : { 94 524971 : MooseObjectWarehouse<MaterialBase>::jacobianSetup(tid); 95 524971 : _neighbor_materials.jacobianSetup(tid); 96 524971 : _face_materials.jacobianSetup(tid); 97 524971 : } 98 : 99 : void 100 1015787 : MaterialWarehouse::updateActive(THREAD_ID tid /*=0*/) 101 : { 102 1015787 : MooseObjectWarehouse<MaterialBase>::updateActive(tid); 103 1015787 : _neighbor_materials.updateActive(tid); 104 1015787 : _face_materials.updateActive(tid); 105 1015787 : } 106 : 107 : void 108 16404 : MaterialWarehouse::sort(THREAD_ID tid /*=0*/) 109 : { 110 16404 : checkThreadID(tid); 111 : 112 28683 : for (auto & object_pair : _all_block_objects[tid]) 113 12283 : sortHelper(object_pair.second); 114 17147 : for (auto & object_pair : _all_boundary_objects[tid]) 115 747 : sortHelper(object_pair.second); 116 : 117 24567 : for (auto & object_pair : _neighbor_materials._all_block_objects[tid]) 118 8167 : sortHelper(object_pair.second); 119 16400 : for (auto & object_pair : _neighbor_materials._all_boundary_objects[tid]) 120 0 : sortHelper(object_pair.second); 121 : 122 24567 : for (auto & object_pair : _face_materials._all_block_objects[tid]) 123 8167 : sortHelper(object_pair.second); 124 16400 : for (auto & object_pair : _face_materials._all_boundary_objects[tid]) 125 0 : sortHelper(object_pair.second); 126 : 127 16400 : updateActive(tid); 128 16400 : }