LCOV - code coverage report
Current view: top level - src/materials - MaterialWarehouse.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31730 (e8b711) with base e0c998 Lines: 63 72 87.5 %
Date: 2025-10-29 16:49:47 Functions: 10 12 83.3 %
Legend: Lines: hit not hit

          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       23460 : 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       23460 :   MooseObjectWarehouse<MaterialBase>::addObject(block, tid);
      21       23460 :   _neighbor_materials.addObject(neighbor, tid);
      22       23460 :   _face_materials.addObject(face, tid);
      23       23460 : }
      24             : 
      25             : const MooseObjectWarehouse<MaterialBase> &
      26    32829834 : MaterialWarehouse::operator[](Moose::MaterialDataType data_type) const
      27             : {
      28    32829834 :   switch (data_type)
      29             :   {
      30    12928338 :     case Moose::NEIGHBOR_MATERIAL_DATA:
      31    12928338 :       return _neighbor_materials;
      32             : 
      33    19898598 :     case Moose::FACE_MATERIAL_DATA:
      34    19898598 :       return _face_materials;
      35             : 
      36        2898 :     default:
      37        2898 :       return *this;
      38             :   }
      39             : }
      40             : 
      41             : void
      42        9545 : MaterialWarehouse::initialSetup(THREAD_ID tid /*=0*/) const
      43             : {
      44        9545 :   MooseObjectWarehouse<MaterialBase>::initialSetup(tid);
      45        9525 :   _neighbor_materials.initialSetup(tid);
      46        9525 :   _face_materials.initialSetup(tid);
      47        9525 : }
      48             : 
      49             : void
      50      315089 : MaterialWarehouse::timestepSetup(THREAD_ID tid /*=0*/) const
      51             : {
      52      315089 :   MooseObjectWarehouse<MaterialBase>::timestepSetup(tid);
      53      315089 :   _neighbor_materials.timestepSetup(tid);
      54      315089 :   _face_materials.timestepSetup(tid);
      55      315089 : }
      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     6062991 : MaterialWarehouse::subdomainSetup(SubdomainID id, THREAD_ID tid /*=0*/) const
      72             : {
      73     6062991 :   MooseObjectWarehouse<MaterialBase>::subdomainSetup(id, tid);
      74     6062991 :   _face_materials.subdomainSetup(id, tid);
      75     6062991 : }
      76             : 
      77             : void
      78    18304388 : MaterialWarehouse::neighborSubdomainSetup(SubdomainID id, THREAD_ID tid /*=0*/) const
      79             : {
      80    18304388 :   _neighbor_materials.subdomainSetup(id, tid);
      81    18304388 : }
      82             : 
      83             : void
      84     3642418 : MaterialWarehouse::residualSetup(THREAD_ID tid /*=0*/) const
      85             : {
      86     3642418 :   MooseObjectWarehouse<MaterialBase>::residualSetup(tid);
      87     3642418 :   _neighbor_materials.residualSetup(tid);
      88     3642418 :   _face_materials.residualSetup(tid);
      89     3642418 : }
      90             : 
      91             : void
      92      576103 : MaterialWarehouse::jacobianSetup(THREAD_ID tid /*=0*/) const
      93             : {
      94      576103 :   MooseObjectWarehouse<MaterialBase>::jacobianSetup(tid);
      95      576103 :   _neighbor_materials.jacobianSetup(tid);
      96      576103 :   _face_materials.jacobianSetup(tid);
      97      576103 : }
      98             : 
      99             : void
     100     1351984 : MaterialWarehouse::updateActive(THREAD_ID tid /*=0*/)
     101             : {
     102     1351984 :   MooseObjectWarehouse<MaterialBase>::updateActive(tid);
     103     1351984 :   _neighbor_materials.updateActive(tid);
     104     1351984 :   _face_materials.updateActive(tid);
     105     1351984 : }
     106             : 
     107             : void
     108       25175 : MaterialWarehouse::sort(THREAD_ID tid /*=0*/, bool sort_all_objects /*=false*/)
     109             : {
     110       25175 :   checkThreadID(tid);
     111             : 
     112       39225 :   for (auto & object_pair : _all_block_objects[tid])
     113       14056 :     sortHelper(object_pair.second);
     114       25978 :   for (auto & object_pair : _all_boundary_objects[tid])
     115         809 :     sortHelper(object_pair.second);
     116             : 
     117       34742 :   for (auto & object_pair : _neighbor_materials._all_block_objects[tid])
     118        9573 :     sortHelper(object_pair.second);
     119       25169 :   for (auto & object_pair : _neighbor_materials._all_boundary_objects[tid])
     120           0 :     sortHelper(object_pair.second);
     121             : 
     122       34742 :   for (auto & object_pair : _face_materials._all_block_objects[tid])
     123        9573 :     sortHelper(object_pair.second);
     124       25169 :   for (auto & object_pair : _face_materials._all_boundary_objects[tid])
     125           0 :     sortHelper(object_pair.second);
     126             : 
     127       25169 :   if (sort_all_objects)
     128             :   {
     129        5957 :     sortHelper(_all_objects[tid]);
     130        5957 :     sortHelper(_neighbor_materials._all_objects[tid]);
     131        5957 :     sortHelper(_face_materials._all_objects[tid]);
     132             :   }
     133             : 
     134       25169 :   updateActive(tid);
     135       25169 : }

Generated by: LCOV version 1.14