GEOS
MeshObjectManager.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2019 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2019 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2019 Total, S.A
8  * Copyright (c) 2019- GEOS/GEOSX Contributors
9  * All right reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_LINEARALGEBRA_MULTISCALE_MULTISCALEOBJECTMANAGER_HPP
20 #define GEOS_LINEARALGEBRA_MULTISCALE_MULTISCALEOBJECTMANAGER_HPP
21 
24 
25 namespace geos
26 {
27 namespace multiscale
28 {
29 
44 {
45 public:
46 
49 
51  using MapViewConst = decltype( std::declval< MapType >().base().toViewConst() );
52 
58  MeshObjectManager( string const & name, dataRepository::Group * parent );
59 
60  string getCatalogName() const final
61  {
62  return "MultiscaleObjectManager"; // doesn't matter really
63  }
64 
68  localIndex numOwnedObjects() const { return m_numOwnedObjects; }
69 
74  void setNumOwnedObjects( localIndex const n );
75 
79  MapType & toDualRelation() { return m_toDualRelation; }
80 
84  MapViewConst toDualRelation() const { return m_toDualRelation.base().toViewConst(); }
85 
90  {
92  static constexpr char const * dualObjectString() { return "dualObject"; }
93  };
94 
95 private:
96 
97  localIndex m_numOwnedObjects;
98 
99  MapType m_toDualRelation;
100 
101 };
102 
103 } // namespace multiscale
104 } // namespace geos
105 
106 #endif //GEOS_LINEARALGEBRA_MULTISCALE_MULTISCALEOBJECTMANAGER_HPP
const base_type & base() const
Get a reference to this object cast to BASETYPE const.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
Mesh object manager used in multiscale preconditioners to keep a simplified (node/cell only) represen...
InterObjectRelation< ArrayOfSets< localIndex > > MapType
Alias for relation map type.
string getCatalogName() const final
Get the name of the catalog.
void setNumOwnedObjects(localIndex const n)
Set the number of locally owned objects.
decltype(std::declval< MapType >().base().toViewConst()) MapViewConst
Alias for relation map const view type.
MeshObjectManager(string const &name, dataRepository::Group *parent)
Constructor.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84
struct to serve as a container for variable strings and keys
contains the added view access keys to be bound with class data member.