GEOSX
CellBlockManager.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_MESH_CELLBLOCKMANAGER_H_
20 #define GEOSX_MESH_CELLBLOCKMANAGER_H_
21 
22 #include "CellBlock.hpp"
23 
24 namespace geosx
25 {
26 
27 namespace dataRepository
28 {
29 namespace keys
30 {
32 string const cellBlocks = "cellBlocks";
33 }
34 }
35 
41 {
42 public:
43 
48  static string CatalogName()
49  {
50  return "CellBlockManager";
51  }
52 
53  virtual const string getCatalogName() const override final
54  { return CellBlockManager::CatalogName(); }
55 
56 
62  CellBlockManager( string const & name, Group * const parent );
63 
67  virtual ~CellBlockManager() override;
68 
69  virtual Group * CreateChild( string const & childKey, string const & childName ) override;
70 
71  using Group::resize;
72 
79  void resize( integer_array const & numElements,
80  string_array const & regionNames,
81  string_array const & elementTypes );
82 
83 // CellBlock & CreateRegion( string const & regionName,
84 // string const & elementType,
85 // integer const & numElements );
86 
92  CellBlock * GetRegion( string const & regionName )
93  {
94  return this->GetGroup( dataRepository::keys::cellBlocks )->GetGroup< CellBlock >( regionName );
95  }
96 
97 
103  template< typename LAMBDA >
104  void forElementSubRegions( LAMBDA lambda )
105  {
106  Group * elementRegions = this->GetGroup( dataRepository::keys::cellBlocks );
107  elementRegions->forSubGroups< CellBlock >( lambda );
108  }
109 private:
110 
115 
120  CellBlockManager & operator=( const CellBlockManager & );
121 
122 
123 };
124 }
125 #endif /* GEOSX_MESH_CELLBLOCKMANAGER_H_ */
The CellBlockManager class provides an interface to ObjectManagerBase in order to manage CellBlock da...
CellBlock * GetRegion(string const &regionName)
Get element sub-region.
virtual void resize(localIndex const newSize)
Resize the group and all contained wrappers that resize with parent.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
void forElementSubRegions(LAMBDA lambda)
Launch kernel function over all the sub-regions.
virtual const string getCatalogName() const override final
Get the name of the catalog.
string const cellBlocks
String for cellBlocks.
static string CatalogName()
The function is to return the name of the CellBlockManager in the object catalog. ...
void forSubGroups(LAMBDA lambda)
Apply the given functor to subgroups that can be casted to one of specified types.
Definition: Group.hpp:593
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55
T * GetGroup(localIndex index)
Retrieve a sub-group from the current Group using an index.
Definition: Group.hpp:374