GEOSX
ElementRegionManager.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_ELEMENTREGIONMANAGER_HPP
20 #define GEOSX_MESH_ELEMENTREGIONMANAGER_HPP
21 
22 #include "CellBlock.hpp"
23 #include "constitutive/ConstitutiveManager.hpp"
24 #include "CellElementRegion.hpp"
25 #include "CellElementSubRegion.hpp"
28 #include "SurfaceElementRegion.hpp"
30 #include "WellElementRegion.hpp"
31 
32 namespace geosx
33 {
34 
35 class MeshManager;
36 
43 {
44 public:
45 
49  constexpr static int maxNumNodesPerElem = 8;
50 
55  template< typename VIEWTYPE >
57 
63  template< typename VIEWTYPE >
65 
71  template< typename VIEWTYPE >
73 
78  template< typename VIEWTYPE >
80 
86  template< typename VIEWTYPE >
88 
93  template< typename CONSTITUTIVE_TYPE >
95 
100  static const string CatalogName()
101  { return "ZoneManager"; }
102 
107  virtual const string getCatalogName() const override final
109 
115  ElementRegionManager( string const & name, Group * const parent );
116 
120  virtual ~ElementRegionManager() override;
121 
126  template< typename T = ElementSubRegionBase >
128  {
129  localIndex numElem = 0;
130  this->forElementSubRegions< T >( [&]( ElementSubRegionBase const & cellBlock )
131  {
132  numElem += cellBlock.size();
133  } );
134  return numElem;
135  }
136 
137 // void Initialize( ){}
138 
143  void GenerateMesh( Group * const cellBlockManager );
144 
149  void GenerateCellToEdgeMaps( FaceManager const * const faceManager );
150 
156  void GenerateAggregates( FaceManager const * const faceManager, NodeManager const * const nodeManager );
157 
163  void GenerateWells( MeshManager * const meshManager, MeshLevel * const meshLevel );
164 
171  virtual Group * CreateChild( string const & childKey, string const & childName ) override;
172 // virtual void ReadXMLsub( xmlWrapper::xmlNode const & targetNode ) override;
173 
177  virtual void ExpandObjectCatalogs() override;
178 
185  virtual void SetSchemaDeviations( xmlWrapper::xmlNode schemaRoot,
186  xmlWrapper::xmlNode schemaParent,
187  integer documentationType ) override;
188 
189  using Group::resize;
190 
197  void resize( integer_array const & numElements,
198  string_array const & regionNames,
199  string_array const & elementTypes );
200 
204  void SetMaxGlobalIndex();
205 
210  subGroupMap const & GetRegions() const
211  {
212  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetSubGroups();
213  }
214 
220  {
221  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetSubGroups();
222  }
223 
229  template< typename T=ElementRegionBase >
230  T const * GetRegion( string const & regionName ) const
231  {
232  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetGroup< T >( regionName );
233  }
234 
240  template< typename T=ElementRegionBase >
241  T * GetRegion( string const & regionName )
242  {
243  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetGroup< T >( regionName );
244  }
245 
251  template< typename T=ElementRegionBase >
252  T const * GetRegion( localIndex const index ) const
253  {
254  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetGroup< T >( index );
255  }
256 
262  template< typename T=ElementRegionBase >
263  T * GetRegion( localIndex const index )
264  {
265  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetGroup< T >( index );
266  }
267 
273  {
274  return this->GetGroup( groupKeyStruct::elementRegionsGroup )->GetSubGroups().size();
275  }
276 
281  localIndex numCellBlocks() const;
282 
289  template< typename REGIONTYPE = ElementRegionBase, typename ... REGIONTYPES, typename LAMBDA >
290  void forElementRegions( LAMBDA && lambda )
291  {
292  Group * const elementRegions = this->GetGroup( groupKeyStruct::elementRegionsGroup );
293  elementRegions->forSubGroups< REGIONTYPE, REGIONTYPES... >( std::forward< LAMBDA >( lambda ) );
294  }
295 
302  template< typename REGIONTYPE = ElementRegionBase, typename ... REGIONTYPES, typename LAMBDA >
303  void forElementRegions( LAMBDA && lambda ) const
304  {
305  Group const * const elementRegions = this->GetGroup( groupKeyStruct::elementRegionsGroup );
306  elementRegions->forSubGroups< REGIONTYPE, REGIONTYPES... >( std::forward< LAMBDA >( lambda ) );
307  }
308 
317  template< typename REGIONTYPE = ElementRegionBase, typename ... REGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
318  void forElementRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda )
319  {
320  Group * const elementRegions = this->GetGroup( groupKeyStruct::elementRegionsGroup );
321  elementRegions->forSubGroups< REGIONTYPE, REGIONTYPES... >( targetRegions, std::forward< LAMBDA >( lambda ) );
322  }
323 
332  template< typename REGIONTYPE = ElementRegionBase, typename ... REGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
333  void forElementRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda ) const
334  {
335  Group const * const elementRegions = this->GetGroup( groupKeyStruct::elementRegionsGroup );
336  elementRegions->forSubGroups< REGIONTYPE, REGIONTYPES... >( targetRegions, std::forward< LAMBDA >( lambda ) );
337  }
338 
344  template< typename LAMBDA >
345  void forElementRegionsComplete( LAMBDA lambda ) const
346  {
348  WellElementRegion >( std::forward< LAMBDA >( lambda ) );
349  }
350 
356  template< typename LAMBDA >
357  void forElementRegionsComplete( LAMBDA lambda )
358  {
360  WellElementRegion >( std::forward< LAMBDA >( lambda ) );
361  }
362 
369  template< typename REGIONTYPE, typename ... REGIONTYPES, typename LAMBDA >
370  void forElementRegionsComplete( LAMBDA lambda )
371  {
372  for( localIndex er=0; er<this->numRegions(); ++er )
373  {
374  ElementRegionBase & elementRegion = *this->GetRegion( er );
375 
376  Group::applyLambdaToContainer< REGIONTYPE, REGIONTYPES... >( elementRegion, [&]( auto & castedRegion )
377  {
378  lambda( er, castedRegion );
379  } );
380  }
381  }
382 
389  template< typename REGIONTYPE, typename ... REGIONTYPES, typename LAMBDA >
390  void forElementRegionsComplete( LAMBDA lambda ) const
391  {
392  for( localIndex er=0; er<this->numRegions(); ++er )
393  {
394  ElementRegionBase const & elementRegion = *this->GetRegion( er );
395 
396  Group::applyLambdaToContainer< REGIONTYPE, REGIONTYPES... >( elementRegion, [&]( auto const & castedRegion )
397  {
398  lambda( er, castedRegion );
399  } );
400  }
401  }
402 
410  template< typename LOOKUP_CONTAINER, typename LAMBDA >
411  void forElementRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA lambda ) const
412  {
414  WellElementRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
415  }
416 
424  template< typename LOOKUP_CONTAINER, typename LAMBDA >
425  void forElementRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA lambda )
426  {
428  WellElementRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
429  }
430 
439  template< typename REGIONTYPE, typename ... REGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
440  void forElementRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA lambda )
441  {
442  forElementRegions< REGIONTYPE, REGIONTYPES... >( targetRegions, [&] ( localIndex const targetIndex,
443  auto & elementRegion )
444  {
445  lambda( targetIndex, elementRegion.getIndexInParent(), elementRegion );
446  } );
447  }
448 
457  template< typename REGIONTYPE, typename ... REGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
458  void forElementRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA lambda ) const
459  {
460  forElementRegions< REGIONTYPE, REGIONTYPES... >( targetRegions, [&] ( localIndex const targetIndex,
461  auto const & elementRegion )
462  {
463  lambda( targetIndex, elementRegion.getIndexInParent(), elementRegion );
464  } );
465  }
466 
472  template< typename LAMBDA >
473  void forElementSubRegions( LAMBDA && lambda )
474  {
476  WellElementSubRegion >( std::forward< LAMBDA >( lambda ) );
477  }
478 
485  template< typename LAMBDA >
486  void forElementSubRegions( LAMBDA && lambda ) const
487  {
489  WellElementSubRegion >( std::forward< LAMBDA >( lambda ) );
490  }
491 
499  template< typename LOOKUP_CONTAINER, typename LAMBDA >
500  void forElementSubRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda )
501  {
503  WellElementSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
504  }
505 
513  template< typename LOOKUP_CONTAINER, typename LAMBDA >
514  void forElementSubRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda ) const
515  {
517  WellElementSubRegion >( targetRegions, std::forward< LAMBDA >( lambda ) );
518  }
519 
526  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LAMBDA >
527  void forElementSubRegions( LAMBDA && lambda )
528  {
529  forElementSubRegionsComplete< SUBREGIONTYPE, SUBREGIONTYPES... >(
530  [lambda = std::forward< LAMBDA >( lambda )]( localIndex const,
531  localIndex const,
533  auto & subRegion )
534  {
535  lambda( subRegion );
536  }
537  );
538  }
539 
546  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LAMBDA >
547  void forElementSubRegions( LAMBDA && lambda ) const
548  {
549  forElementSubRegionsComplete< SUBREGIONTYPE, SUBREGIONTYPES... >(
550  [lambda = std::forward< LAMBDA >( lambda )]( localIndex const,
551  localIndex const,
552  ElementRegionBase const &,
553  auto const & subRegion )
554  {
555  lambda( subRegion );
556  } );
557  }
558 
567  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
568  void forElementSubRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda )
569  {
570  forElementSubRegionsComplete< SUBREGIONTYPE, SUBREGIONTYPES... >( targetRegions,
571  [lambda = std::forward< LAMBDA >( lambda )]( localIndex const targetIndex,
572  localIndex const,
573  localIndex const,
575  auto & subRegion )
576  {
577  lambda( targetIndex, subRegion );
578  } );
579  }
580 
589  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
590  void forElementSubRegions( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda ) const
591  {
592  forElementSubRegionsComplete< SUBREGIONTYPE, SUBREGIONTYPES... >( targetRegions,
593  [lambda = std::forward< LAMBDA >( lambda )]( localIndex const targetIndex,
594  localIndex const,
595  localIndex const,
596  ElementRegionBase const &,
597  auto const & subRegion )
598  {
599  lambda( targetIndex, subRegion );
600  } );
601  }
602 
608  template< typename LAMBDA >
609  void forElementSubRegionsComplete( LAMBDA && lambda ) const
610  {
612  WellElementSubRegion >( std::forward< LAMBDA >( lambda ) );
613  }
614 
620  template< typename LAMBDA >
621  void forElementSubRegionsComplete( LAMBDA && lambda )
622  {
624  WellElementSubRegion >( std::forward< LAMBDA >( lambda ) );
625  }
626 
634  template< typename LOOKUP_CONTAINER, typename LAMBDA >
635  void forElementSubRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda )
636  {
637  forElementSubRegionsComplete< CellElementSubRegion, FaceElementSubRegion, EmbeddedSurfaceSubRegion, WellElementSubRegion >( targetRegions,
638  std::forward< LAMBDA >( lambda ) );
639  }
640 
648  template< typename LOOKUP_CONTAINER, typename LAMBDA >
649  void forElementSubRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda ) const
650  {
651  forElementSubRegionsComplete< CellElementSubRegion, FaceElementSubRegion, EmbeddedSurfaceSubRegion, WellElementSubRegion >( targetRegions,
652  std::forward< LAMBDA >( lambda ) );
653  }
654 
661  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LAMBDA >
662  void forElementSubRegionsComplete( LAMBDA && lambda )
663  {
664  for( localIndex er=0; er<this->numRegions(); ++er )
665  {
666  ElementRegionBase & elementRegion = *this->GetRegion( er );
667 
668  for( localIndex esr=0; esr<elementRegion.numSubRegions(); ++esr )
669  {
670  ElementSubRegionBase & subRegion = *elementRegion.GetSubRegion( esr );
671 
672  Group::applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&]( auto & castedSubRegion )
673  {
674  lambda( er, esr, elementRegion, castedSubRegion );
675  } );
676  }
677  }
678  }
679 
686  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LAMBDA >
687  void forElementSubRegionsComplete( LAMBDA && lambda ) const
688  {
689  for( localIndex er=0; er<this->numRegions(); ++er )
690  {
691  ElementRegionBase const & elementRegion = *this->GetRegion( er );
692 
693  for( localIndex esr=0; esr<elementRegion.numSubRegions(); ++esr )
694  {
695  ElementSubRegionBase const & subRegion = *elementRegion.GetSubRegion( esr );
696 
697  Group::applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&]( auto const & castedSubRegion )
698  {
699  lambda( er, esr, elementRegion, castedSubRegion );
700  } );
701  }
702  }
703  }
704 
713  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
714  void forElementSubRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda )
715  {
716  forElementRegions( targetRegions, [&] ( localIndex const targetIndex, ElementRegionBase & elementRegion )
717  {
718  localIndex const er = elementRegion.getIndexInParent();
719 
720  for( localIndex esr=0; esr<elementRegion.numSubRegions(); ++esr )
721  {
722  ElementSubRegionBase & subRegion = *elementRegion.GetSubRegion( esr );
723 
724  Group::applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&]( auto & castedSubRegion )
725  {
726  lambda( targetIndex, er, esr, elementRegion, castedSubRegion );
727  } );
728  }
729  } );
730  }
731 
740  template< typename SUBREGIONTYPE, typename ... SUBREGIONTYPES, typename LOOKUP_CONTAINER, typename LAMBDA >
741  void forElementSubRegionsComplete( LOOKUP_CONTAINER const & targetRegions, LAMBDA && lambda ) const
742  {
743  forElementRegions( targetRegions, [&] ( localIndex const targetIndex, ElementRegionBase const & elementRegion )
744  {
745  localIndex const er = elementRegion.getIndexInParent();
746 
747  for( localIndex esr=0; esr<elementRegion.numSubRegions(); ++esr )
748  {
749  ElementSubRegionBase const & subRegion = *elementRegion.GetSubRegion( esr );
750 
751  Group::applyLambdaToContainer< SUBREGIONTYPE, SUBREGIONTYPES... >( subRegion, [&]( auto const & castedSubRegion )
752  {
753  lambda( targetIndex, er, esr, elementRegion, castedSubRegion );
754  } );
755  }
756  } );
757  }
758 
766  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
768  ConstructViewAccessor( string const & name, string const & neighborName = string() ) const;
769 
777  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
779  ConstructViewAccessor( string const & name, string const & neighborName = string() );
780 
789  template< typename T, int NDIM >
791  ConstructArrayViewAccessor( string const & name, string const & neighborName = string() ) const;
792 
800  template< typename VIEWTYPE >
802  ConstructReferenceAccessor( string const & viewName, string const & neighborName = string() ) const;
803 
811  template< typename VIEWTYPE >
813  ConstructReferenceAccessor( string const & viewName, string const & neighborName = string() );
814 
822  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
824  ConstructFullMaterialViewAccessor( string const & viewName,
825  constitutive::ConstitutiveManager const * const cm ) const;
826 
834  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
836  ConstructFullMaterialViewAccessor( string const & viewName,
837  constitutive::ConstitutiveManager const * const cm );
838 
850  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
852  ConstructMaterialViewAccessor( string const & viewName,
853  arrayView1d< string const > const & regionNames,
854  arrayView1d< string const > const & materialNames,
855  bool const allowMissingViews = false ) const;
856 
868  template< typename VIEWTYPE, typename LHS=VIEWTYPE >
870  ConstructMaterialViewAccessor( string const & viewName,
871  arrayView1d< string const > const & regionNames,
872  arrayView1d< string const > const & materialNames,
873  bool const allowMissingViews = false );
874 
885  template< typename T, int NDIM >
887  ConstructMaterialArrayViewAccessor( string const & viewName,
888  arrayView1d< string const > const & regionNames,
889  arrayView1d< string const > const & materialNames,
890  bool const allowMissingViews = false ) const;
891 
898  template< typename CONSTITUTIVE_TYPE >
900  ConstructFullConstitutiveAccessor( constitutive::ConstitutiveManager const * const cm ) const;
901 
902 
909  template< typename CONSTITUTIVE_TYPE >
911  ConstructFullConstitutiveAccessor( constitutive::ConstitutiveManager const * const cm );
912 
913  using Group::PackSize;
914  using Group::Pack;
921 
928  int PackSize( string_array const & wrapperNames,
929  ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
930 
938  int Pack( buffer_unit_type * & buffer,
939  string_array const & wrapperNames,
940  ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
941 
944 
951  int Unpack( buffer_unit_type const * & buffer,
953 
960  int Unpack( buffer_unit_type const * & buffer,
962 
968  int PackGlobalMapsSize( ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
969 
976  int PackGlobalMaps( buffer_unit_type * & buffer,
977  ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
978 
985  int UnpackGlobalMaps( buffer_unit_type const * & buffer,
987 
993  int PackUpDownMapsSize( ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
994 
1000  int PackUpDownMapsSize( ElementReferenceAccessor< array1d< localIndex > > const & packList ) const;
1001 
1008  int PackUpDownMaps( buffer_unit_type * & buffer,
1009  ElementViewAccessor< arrayView1d< localIndex > > const & packList ) const;
1010 
1017  int PackUpDownMaps( buffer_unit_type * & buffer,
1018  ElementReferenceAccessor< array1d< localIndex > > const & packList ) const;
1019 
1027  int UnpackUpDownMaps( buffer_unit_type const * & buffer,
1029  bool const overwriteMap );
1030 
1036  {
1038  static constexpr auto elementRegionsGroup = "elementRegionsGroup";
1040 
1041 
1042 private:
1043 
1051  template< bool DOPACK >
1052  int PackPrivate( buffer_unit_type * & buffer,
1053  string_array const & wrapperNames,
1054  ElementViewAccessor< arrayView1d< localIndex > > const & viewAccessor ) const;
1055 
1062  template< bool DOPACK >
1063  int PackGlobalMapsPrivate( buffer_unit_type * & buffer,
1064  ElementViewAccessor< arrayView1d< localIndex > > const & viewAccessor ) const;
1065 
1072  template< bool DOPACK, typename T >
1073  int
1074  PackUpDownMapsPrivate( buffer_unit_type * & buffer,
1075  T const & packList ) const;
1082  template< typename T >
1083  int UnpackPrivate( buffer_unit_type const * & buffer,
1084  T & packList );
1085 
1090 
1095  ElementRegionManager & operator=( const ElementRegionManager & );
1096 };
1097 
1098 
1099 template< typename VIEWTYPE, typename LHS >
1101 ElementRegionManager::ConstructViewAccessor( string const & viewName, string const & neighborName ) const
1102 {
1103  ElementViewAccessor< LHS > viewAccessor;
1104  viewAccessor.resize( numRegions() );
1105  for( typename dataRepository::indexType kReg=0; kReg<numRegions(); ++kReg )
1106  {
1107  ElementRegionBase const * const elemRegion = GetRegion( kReg );
1108  viewAccessor[kReg].resize( elemRegion->numSubRegions() );
1109 
1110  for( typename dataRepository::indexType kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1111  {
1112  Group const * group = elemRegion->GetSubRegion( kSubReg );
1113 
1114  if( !neighborName.empty() )
1115  {
1116  group = group->GetGroup( ObjectManagerBase::groupKeyStruct::neighborDataString )->GetGroup( neighborName );
1117  }
1118 
1119  if( group->hasWrapper( viewName ) && group->getWrapperBase( viewName )->get_typeid() == typeid( VIEWTYPE ) )
1120  {
1121  viewAccessor[kReg][kSubReg] = group->getReference< VIEWTYPE >( viewName );
1122  }
1123  }
1124  }
1125  return viewAccessor;
1126 }
1127 
1128 
1129 template< typename VIEWTYPE, typename LHS >
1132  ConstructViewAccessor( string const & viewName, string const & neighborName )
1133 {
1134  ElementViewAccessor< LHS > viewAccessor;
1135  viewAccessor.resize( numRegions() );
1136  for( typename dataRepository::indexType kReg=0; kReg<numRegions(); ++kReg )
1137  {
1138  ElementRegionBase * const elemRegion = GetRegion( kReg );
1139  viewAccessor[kReg].resize( elemRegion->numSubRegions() );
1140 
1141  for( typename dataRepository::indexType kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1142  {
1143  Group * group = elemRegion->GetSubRegion( kSubReg );
1144 
1145  if( !neighborName.empty() )
1146  {
1147  group = group->GetGroup( ObjectManagerBase::groupKeyStruct::neighborDataString )->GetGroup( neighborName );
1148  }
1149 
1150  if( group->hasWrapper( viewName ) && group->getWrapperBase( viewName )->get_typeid() == typeid( VIEWTYPE ) )
1151  {
1152  viewAccessor[kReg][kSubReg] = group->getReference< VIEWTYPE >( viewName );
1153  }
1154  }
1155  }
1156  return viewAccessor;
1157 }
1158 
1159 template< typename T, int NDIM >
1162  ConstructArrayViewAccessor( string const & name, string const & neighborName ) const
1163 {
1164  return ConstructViewAccessor< Array< T, NDIM >, ArrayView< T const, NDIM > >( name, neighborName );
1165 }
1166 
1167 template< typename VIEWTYPE >
1170  ConstructReferenceAccessor( string const & viewName, string const & neighborName ) const
1171 {
1173  viewAccessor.resize( numRegions() );
1174  for( typename dataRepository::indexType kReg=0; kReg<numRegions(); ++kReg )
1175  {
1176  ElementRegionBase const * const elemRegion = GetRegion( kReg );
1177  viewAccessor[kReg].resize( elemRegion->numSubRegions() );
1178 
1179  for( typename dataRepository::indexType kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1180  {
1181  Group const * group = elemRegion->GetSubRegion( kSubReg );
1182 
1183  if( !neighborName.empty() )
1184  {
1185  group = group->GetGroup( ObjectManagerBase::groupKeyStruct::neighborDataString )->GetGroup( neighborName );
1186  }
1187 
1188  if( group->hasWrapper( viewName ) )
1189  {
1190  viewAccessor[kReg][kSubReg].set( group->getReference< VIEWTYPE >( viewName ));
1191  }
1192  }
1193  }
1194  return viewAccessor;
1195 }
1196 
1197 template< typename VIEWTYPE >
1200  ConstructReferenceAccessor( string const & viewName, string const & neighborName )
1201 {
1203  viewAccessor.resize( numRegions() );
1204  for( typename dataRepository::indexType kReg=0; kReg<numRegions(); ++kReg )
1205  {
1206  ElementRegionBase * const elemRegion = GetRegion( kReg );
1207  viewAccessor[kReg].resize( elemRegion->numSubRegions() );
1208 
1209  for( typename dataRepository::indexType kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1210  {
1211  Group * group = elemRegion->GetSubRegion( kSubReg );
1212 
1213  if( !neighborName.empty() )
1214  {
1215  group = group->GetGroup( ObjectManagerBase::groupKeyStruct::neighborDataString )->GetGroup( neighborName );
1216  }
1217 
1218  if( group->hasWrapper( viewName ) )
1219  {
1220  viewAccessor[kReg][kSubReg].set( group->getReference< VIEWTYPE >( viewName ));
1221  }
1222  }
1223  }
1224  return viewAccessor;
1225 }
1226 
1227 template< typename VIEWTYPE, typename LHS >
1230  ConstructFullMaterialViewAccessor( string const & viewName,
1231  constitutive::ConstitutiveManager const * const cm ) const
1232 {
1233  MaterialViewAccessor< LHS > accessor;
1234  accessor.resize( numRegions() );
1235  for( localIndex kReg=0; kReg<numRegions(); ++kReg )
1236  {
1237  ElementRegionBase const * const elemRegion = GetRegion( kReg );
1238  accessor[kReg].resize( elemRegion->numSubRegions() );
1239 
1240  for( localIndex kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1241  {
1242  ElementSubRegionBase const * const subRegion = elemRegion->GetSubRegion( kSubReg );
1243  dataRepository::Group const * const constitutiveGroup = subRegion->GetConstitutiveModels();
1244 
1245  accessor[kReg][kSubReg].resize( cm->numSubGroups() );
1246 
1247  for( localIndex matIndex=0; matIndex<cm->numSubGroups(); ++matIndex )
1248  {
1249  string constitutiveName = cm->GetGroup( matIndex )->getName();
1250  dataRepository::Group const * const constitutiveRelation = constitutiveGroup->GetGroup( constitutiveName );
1251  if( constitutiveRelation != nullptr )
1252  {
1254  wrapper = constitutiveRelation->getWrapper< VIEWTYPE >( viewName );
1255 
1256  if( wrapper != nullptr )
1257  {
1258  accessor[kReg][kSubReg][matIndex] = wrapper->reference();
1259  }
1260  }
1261  }
1262  }
1263  }
1264  return accessor;
1265 }
1266 
1267 template< typename VIEWTYPE, typename LHS >
1270  ConstructFullMaterialViewAccessor( string const & viewName,
1271  constitutive::ConstitutiveManager const * const cm )
1272 {
1273  MaterialViewAccessor< LHS > accessor;
1274  accessor.resize( numRegions() );
1275  for( localIndex kReg=0; kReg<numRegions(); ++kReg )
1276  {
1277  ElementRegionBase * const elemRegion = GetRegion( kReg );
1278  accessor[kReg].resize( elemRegion->numSubRegions() );
1279 
1280  for( localIndex kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1281  {
1282  ElementSubRegionBase * const subRegion = elemRegion->GetSubRegion( kSubReg );
1283  dataRepository::Group * const constitutiveGroup = subRegion->GetConstitutiveModels();
1284 
1285  accessor[kReg][kSubReg].resize( cm->numSubGroups() );
1286 
1287  for( localIndex matIndex=0; matIndex<cm->numSubGroups(); ++matIndex )
1288  {
1289  string constitutiveName = cm->GetGroup( matIndex )->getName();
1290  dataRepository::Group * const constitutiveRelation = constitutiveGroup->GetGroup( constitutiveName );
1291  if( constitutiveRelation != nullptr )
1292  {
1294  wrapper = constitutiveRelation->getWrapper< VIEWTYPE >( viewName );
1295 
1296  if( wrapper != nullptr )
1297  {
1298  accessor[kReg][kSubReg][matIndex] = wrapper->reference();
1299  }
1300  }
1301  }
1302  }
1303  }
1304  return accessor;
1305 }
1306 
1307 template< typename VIEWTYPE, typename LHS >
1310  arrayView1d< string const > const & regionNames,
1311  arrayView1d< string const > const & materialNames,
1312  bool const allowMissingViews ) const
1313 {
1314  GEOSX_ASSERT_EQ( regionNames.size(), materialNames.size() );
1315  ElementViewAccessor< LHS > accessor;
1316 
1317  // Resize the accessor to all regions and subregions
1318  accessor.resize( numRegions() );
1319  for( localIndex kReg = 0; kReg < numRegions(); ++kReg )
1320  {
1321  accessor[kReg].resize( GetRegion( kReg )->numSubRegions() );
1322  }
1323 
1324  subGroupMap const & regionMap = GetRegions();
1325 
1326  // Loop only over regions named and populate according to given material names
1327  for( localIndex k = 0; k < regionNames.size(); ++k )
1328  {
1329  localIndex const er = regionMap.getIndex( regionNames[k] );
1330  GEOSX_ERROR_IF_EQ_MSG( er, subGroupMap::KeyIndex::invalid_index, "Region not found: " << regionNames[k] );
1331  ElementRegionBase const & region = *GetRegion( er );
1332 
1333  region.forElementSubRegionsIndex( [&]( localIndex const esr,
1334  ElementSubRegionBase const & subRegion )
1335  {
1336  dataRepository::Group const & constitutiveGroup = *subRegion.GetConstitutiveModels();
1337  dataRepository::Group const * const constitutiveRelation = constitutiveGroup.GetGroup( materialNames[k] );
1338  GEOSX_ERROR_IF( constitutiveRelation == nullptr,
1339  "Material " << materialNames[k] << " not found in " << regionNames[k] << '/' << subRegion.getName() );
1340  dataRepository::Wrapper< VIEWTYPE > const * const wrapper = constitutiveRelation->getWrapper< VIEWTYPE >( viewName );
1341  GEOSX_ERROR_IF( !allowMissingViews && wrapper == nullptr, "Material " << materialNames[k] << " does not contain " << viewName );
1342  if( wrapper != nullptr )
1343  {
1344  accessor[er][esr] = wrapper->reference();
1345  }
1346  } );
1347  }
1348  return accessor;
1349 }
1350 
1351 template< typename VIEWTYPE, typename LHS >
1354  arrayView1d< string const > const & regionNames,
1355  arrayView1d< string const > const & materialNames,
1356  bool const allowMissingViews )
1357 {
1358  GEOSX_ASSERT_EQ( regionNames.size(), materialNames.size() );
1359  ElementViewAccessor< LHS > accessor;
1360 
1361  // Resize the accessor to all regions and subregions
1362  accessor.resize( numRegions() );
1363  for( localIndex kReg = 0; kReg < numRegions(); ++kReg )
1364  {
1365  accessor[kReg].resize( GetRegion( kReg )->numSubRegions() );
1366  }
1367 
1368  subGroupMap const & regionMap = GetRegions();
1369 
1370  // Loop only over regions named and populate according to given material names
1371  for( localIndex k = 0; k < regionNames.size(); ++k )
1372  {
1373  localIndex const er = regionMap.getIndex( regionNames[k] );
1374  GEOSX_ERROR_IF_EQ_MSG( er, subGroupMap::KeyIndex::invalid_index, "Region not found: " << regionNames[k] );
1375  ElementRegionBase & region = *GetRegion( er );
1376 
1377  region.forElementSubRegionsIndex( [&]( localIndex const esr, ElementSubRegionBase & subRegion )
1378  {
1379  dataRepository::Group & constitutiveGroup = *subRegion.GetConstitutiveModels();
1380  dataRepository::Group * const constitutiveRelation = constitutiveGroup.GetGroup( materialNames[k] );
1381  GEOSX_ERROR_IF( constitutiveRelation == nullptr,
1382  "Material " << materialNames[k] << " not found in " << regionNames[k] << '/' << subRegion.getName() );
1383  dataRepository::Wrapper< VIEWTYPE > * const wrapper = constitutiveRelation->getWrapper< VIEWTYPE >( viewName );
1384  GEOSX_ERROR_IF( !allowMissingViews && wrapper == nullptr, "Material " << materialNames[k] << " does not contain " << viewName );
1385  if( wrapper != nullptr )
1386  {
1387  accessor[er][esr] = wrapper->reference();
1388  }
1389  } );
1390  }
1391  return accessor;
1392 }
1393 
1394 template< typename T, int NDIM >
1397  ConstructMaterialArrayViewAccessor( string const & viewName,
1398  arrayView1d< string const > const & regionNames,
1399  arrayView1d< string const > const & materialNames,
1400  bool const allowMissingViews ) const
1401 {
1402  return ConstructMaterialViewAccessor< Array< T, NDIM >, ArrayView< T const, NDIM > >( viewName,
1403  regionNames,
1404  materialNames,
1405  allowMissingViews );
1406 }
1407 
1408 template< typename CONSTITUTIVE_TYPE >
1410 ElementRegionManager::ConstructFullConstitutiveAccessor( constitutive::ConstitutiveManager const * const cm ) const
1411 {
1413  accessor.resize( numRegions() );
1414  for( localIndex kReg=0; kReg<numRegions(); ++kReg )
1415  {
1416  ElementRegionBase const * const elemRegion = GetRegion( kReg );
1417  accessor[kReg].resize( elemRegion->numSubRegions() );
1418 
1419  for( localIndex kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1420  {
1421  ElementSubRegionBase const * const subRegion = elemRegion->GetSubRegion( kSubReg );
1422  dataRepository::Group const * const
1423  constitutiveGroup = subRegion->GetConstitutiveModels();
1424  accessor[kReg][kSubReg].resize( cm->numSubGroups() );
1425 
1426  for( localIndex matIndex=0; matIndex<cm->numSubGroups(); ++matIndex )
1427  {
1428  string const constitutiveName = cm->GetGroup( matIndex )->getName();
1429 
1430  CONSTITUTIVE_TYPE * const
1431  constitutiveRelation = constitutiveGroup->GetGroup< CONSTITUTIVE_TYPE >( constitutiveName );
1432  if( constitutiveRelation != nullptr )
1433  {
1434  accessor[kReg][kSubReg][matIndex] = constitutiveRelation;
1435  }
1436  }
1437  }
1438  }
1439  return accessor;
1440 }
1441 
1442 template< typename CONSTITUTIVE_TYPE >
1444 ElementRegionManager::ConstructFullConstitutiveAccessor( constitutive::ConstitutiveManager const * const cm )
1445 {
1447  accessor.resize( numRegions() );
1448  for( localIndex kReg=0; kReg<numRegions(); ++kReg )
1449  {
1450  ElementRegionBase * const elemRegion = GetRegion( kReg );
1451  accessor[kReg].resize( elemRegion->numSubRegions() );
1452 
1453  for( localIndex kSubReg=0; kSubReg<elemRegion->numSubRegions(); ++kSubReg )
1454  {
1455  ElementSubRegionBase * const subRegion = elemRegion->GetSubRegion( kSubReg );
1456  dataRepository::Group * const
1457  constitutiveGroup = subRegion->GetConstitutiveModels();
1458  accessor[kReg][kSubReg].resize( cm->numSubGroups() );
1459 
1460  for( localIndex matIndex=0; matIndex<cm->numSubGroups(); ++matIndex )
1461  {
1462  string const constitutiveName = cm->GetGroup( matIndex )->getName();
1463 
1464  CONSTITUTIVE_TYPE * const
1465  constitutiveRelation = constitutiveGroup->GetGroup< CONSTITUTIVE_TYPE >( constitutiveName );
1466  if( constitutiveRelation != nullptr )
1467  {
1468  accessor[kReg][kSubReg][matIndex] = constitutiveRelation;
1469  }
1470  }
1471  }
1472  }
1473  return accessor;
1474 }
1475 
1476 }
1477 #endif /* GEOSX_MESH_ELEMENTREGIONMANAGER_HPP */
ElementViewAccessor< LHS > ConstructViewAccessor(string const &name, string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
subGroupMap & GetRegions()
Get a collection of element regions.
static const string CatalogName()
The function is to return the name of the ElementRegionManager in the object catalog.
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions...
virtual Group * CreateChild(string const &childKey, string const &childName) override
Create a new ElementRegion object as a child of this group.
virtual localIndex UnpackUpDownMaps(buffer_unit_type const *&buffer, array1d< localIndex > &packList, bool const overwriteUpMaps, bool const overwriteDownMaps)
Unpacks the specific elements in the @ packList.
virtual ~ElementRegionManager() override
Destructor.
ConstitutiveRelationAccessor< CONSTITUTIVE_TYPE > ConstructFullConstitutiveAccessor(constitutive::ConstitutiveManager const *const cm) const
Construct a ConstitutiveRelationAccessor.
pugi::xml_node xmlNode
Alias for the type of an xml node.
Definition: xmlWrapper.hpp:60
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target element regions with region...
void GenerateAggregates(FaceManager const *const faceManager, NodeManager const *const nodeManager)
Generate the aggregates.
virtual localIndex PackGlobalMapsSize(arrayView1d< localIndex const > const &packList, integer const recursive) const
Computes the pack size of the global maps elements in the @ packList.
This class specializes the element region for the case of a well. This class is also in charge of sta...
void GenerateWells(MeshManager *const meshManager, MeshLevel *const meshLevel)
Generate the wells.
struct to serve as a container for group strings and keys
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions...
void forElementSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over all the element subregions that can be casted to...
void forElementRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the target element regions with region typ...
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:38
INDEX_TYPE size() const noexcept
Definition: ArrayView.hpp:361
virtual void SetSchemaDeviations(xmlWrapper::xmlNode schemaRoot, xmlWrapper::xmlNode schemaParent, integer documentationType) override
Inform the schema generator of any deviations between the xml and GEOS data structures.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data...
Definition: NodeManager.hpp:47
localIndex numSubRegions() const
Get the number of subregions in the region.
int PackGlobalMaps(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack a buffer.
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda)
This function is used to launch kernel function over the specified target element regions...
void forElementRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the target element regions with region type = El...
Group key associated with elementRegionsGroup struct groupKeyStruct : public ObjectManagerBase::group...
bool hasWrapper(LOOKUP_TYPE const &lookup) const
Check if a wrapper exists.
Definition: Group.hpp:1144
virtual void ExpandObjectCatalogs() override
Expand any catalogs in the data structure.
void forElementSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the element subregions that can be cas...
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions...
void forElementSubRegionsComplete(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of all subregion ty...
int UnpackUpDownMaps(buffer_unit_type const *&buffer, ElementReferenceAccessor< localIndex_array > &packList, bool const overwriteMap)
Unpack element-to-node and element-to-face maps.
void forElementSubRegionsComplete(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of all subregion types...
virtual void resize(localIndex const newSize)
Resize the group and all contained wrappers that resize with parent.
void GenerateMesh(Group *const cellBlockManager)
Generate the mesh.
typename ElementViewAccessor< VIEWTYPE >::NestedViewType ElementView
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
int PackGlobalMapsSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the size of the buffer to be packed.
This class serves to provide a "view" of a multidimensional array.
Definition: ArrayView.hpp:67
void forElementRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the types of element regions...
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions wi...
int UnpackGlobalMaps(buffer_unit_type const *&buffer, ElementViewAccessor< ReferenceWrapper< localIndex_array > > &packList)
Unpack a buffer.
localIndex getNumberOfElements() const
Get the number of elements in all ElementSubRegions of type T.
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda) const
This const function is used to launch kernel function over the specified target element subregions th...
ElementViewAccessor< ReferenceWrapper< VIEWTYPE > > ConstructReferenceAccessor(string const &viewName, string const &neighborName=string()) const
This is a const function to construct a ElementViewAccessor to access the data registered on the mesh...
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
#define GEOSX_ASSERT_EQ(lhs, rhs)
Assert that two values compare equal in debug builds.
Definition: Logger.hpp:254
void forElementSubRegionsIndex(LAMBDA &&lambda) const
Apply LAMBDA to the subregions, loop using subregion indices.
void SetMaxGlobalIndex()
Set the maximum local and global index.
SUBREGIONTYPE const * GetSubRegion(string const &regionName) const
Get a pointer to a subregion by specifying its name.
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
void forElementSubRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions that can...
static constexpr auto neighborDataString
String key to the Groupholding all the NeighborData objects.
int PackSize(string_array const &wrapperNames, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the buffer size needed to pack a list of wrappers.
static bool applyLambdaToContainer(CONTAINERTYPE &container, LAMBDA &&lambda)
Apply a given functor to a container if the container can be cast to one of the specified types...
Definition: Group.hpp:557
ElementViewAccessor< LHS > ConstructMaterialViewAccessor(string const &viewName, arrayView1d< string const > const &regionNames, arrayView1d< string const > const &materialNames, bool const allowMissingViews=false) const
This is a const function to construct a MaterialViewAccessor to access the material data for specifie...
ElementViewAccessor< ArrayView< T const, NDIM > > ConstructArrayViewAccessor(string const &name, string const &neighborName=string()) const
This is a function to construct a ElementViewAccessor to access array data registered on the mesh...
GEOSX_DECLTYPE_AUTO_RETURN getReference(LOOKUP_TYPE const &lookup) const
Look up a wrapper and get reference to wrapped object.
Definition: Group.hpp:1211
T const * GetRegion(string const &regionName) const
Get a element region.
T const * GetRegion(localIndex const index) const
This is a const function to get a element region.
int PackUpDownMapsSize(ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Get the buffer size needed to pack element-to-node and element-to-face maps.
int Pack(buffer_unit_type *&buffer, string_array const &wrapperNames, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack a list of wrappers to a buffer.
virtual localIndex PackUpDownMapsSize(arrayView1d< localIndex const > const &packList) const
Computes the pack size of the specific elements in the @ packList.
MaterialViewAccessor< LHS > ConstructFullMaterialViewAccessor(string const &viewName, constitutive::ConstitutiveManager const *const cm) const
This is a const function to construct a MaterialViewAccessor to access the material data...
void forElementRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the element regions that can be casted to on...
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:146
void forElementRegionsComplete(LAMBDA lambda)
This function is used to launch kernel function over all the types of element regions.
#define GEOSX_ERROR_IF_EQ_MSG(lhs, rhs, msg)
Raise a hard error if two values are equal.
Definition: Logger.hpp:157
T * GetRegion(localIndex const index)
This is a function to get a element region.
Wrapper< T > const * getWrapper(LOOKUP_TYPE const &index) const
Retrieve a Wrapper stored in this group.
Definition: Group.hpp:1157
localIndex getIndexInParent() const
Get the group&#39;s index withing its parent group.
Definition: Group.hpp:1337
virtual localIndex PackSize(string_array const &wrapperNames, integer const recursive, bool on_device=false) const
Get the size required to pack a list of wrappers.
void GenerateCellToEdgeMaps(FaceManager const *const faceManager)
Generate the cell-to-edge map.
T * GetRegion(string const &regionName)
Get a element region.
static constexpr INDEX_TYPE invalid_index
the value of an invalid index
Definition: KeyIndexT.hpp:50
localIndex indexType
The default index type for entries the hierarchy.
Definition: Group.hpp:61
virtual localIndex PackUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const
Packs the specific elements in the @ packList.
virtual const string getCatalogName() const override final
Virtual access to CatalogName()
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
const string getName() const
Get group name.
Definition: Group.hpp:1317
The ElementRegionBase is the base class to manage the data stored at the element level.
ElementRegionManager(string const &name, Group *const parent)
Constructor.
void forElementRegionsComplete(LAMBDA lambda) const
This const function is used to launch kernel function over all the element regions that can be casted...
void forElementSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of the specified su...
virtual std::type_info const & get_typeid() const =0
Get the typeid of T.
T & reference()
Accessor for m_data.
Definition: Wrapper.hpp:588
void resize(int const numDims, DIMS_TYPE const *const dims)
Resize the dimensions of the Array to match the given dimensions.
Definition: Array.hpp:277
void forElementRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over all the element regions with region type =...
void resize(integer_array const &numElements, string_array const &regionNames, string_array const &elementTypes)
Set the number of elements for a set of element regions.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
geosx::ElementRegionManager::groupKeyStruct m_ElementRegionManagerKeys
Element region manager keys.
ElementViewAccessor< ArrayView< T const, NDIM > > ConstructMaterialArrayViewAccessor(string const &viewName, arrayView1d< string const > const &regionNames, arrayView1d< string const > const &materialNames, bool const allowMissingViews=false) const
Construct a view accessor for material data, assuming array as storage type.
void forSubGroups(LAMBDA lambda)
Apply the given functor to subgroups that can be casted to one of specified types.
Definition: Group.hpp:593
localIndex numCellBlocks() const
Get number of the cell blocks.
virtual localIndex UnpackGlobalMaps(buffer_unit_type const *&buffer, localIndex_array &packList, integer const recursive)
Unpacks the global maps from buffer.
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target element regions...
This class manages the mesh objects in GEOSX (reservoir mesh, well mesh)
Definition: MeshManager.hpp:33
static constexpr int maxNumNodesPerElem
void forElementSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of the specified subregio...
dataRepository::Group const * GetConstitutiveModels() const
Get the group in which the constitutive models of this subregion are registered.
int PackUpDownMaps(buffer_unit_type *&buffer, ElementViewAccessor< arrayView1d< localIndex > > const &packList) const
Pack element-to-node and element-to-face maps.
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
#define GEOSX_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
Definition: Logger.hpp:103
static constexpr auto elementRegionsGroup
element regions group string key
void forElementRegionsComplete(LOOKUP_CONTAINER const &targetRegions, LAMBDA lambda) const
This const function is used to launch kernel function over the specified target element regions with ...
virtual localIndex PackGlobalMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList, integer const recursive) const
Packs the global maps elements in the @ packList.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data...
Definition: FaceManager.hpp:40
void forElementRegions(LAMBDA &&lambda)
This function is used to launch kernel function over all the element regions with region type = Eleme...
INDEX_TYPE getIndex(KEY_TYPE const &key) const
void forElementSubRegions(LAMBDA &&lambda) const
This const function is used to launch kernel function over the element subregions of all the subregio...
void forElementSubRegions(LAMBDA &&lambda)
This function is used to launch kernel function over the element subregions of all the subregion type...
virtual localIndex Pack(buffer_unit_type *&buffer, string_array const &wrapperNames, integer const recursive, bool on_device=false) const
Pack a list of wrappers to a buffer.
WrapperBase const * getWrapperBase(indexType const index) const
Retrieve a WrapperBase stored in this group.
Definition: Group.hpp:1058
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions...
virtual localIndex Unpack(buffer_unit_type const *&buffer, arrayView1d< localIndex > &packList, integer const recursive, bool on_device=false) override
Unpack a buffer.
This class describes a collection of local well elements and perforations.
T * GetGroup(localIndex index)
Retrieve a sub-group from the current Group using an index.
Definition: Group.hpp:374
int Unpack(buffer_unit_type const *&buffer, ElementViewAccessor< arrayView1d< localIndex > > &packList)
Unpack a buffer.
subGroupMap const & GetRegions() const
Get a collection of element regions.
localIndex numRegions() const
Get number of the regions.
void forElementSubRegions(LOOKUP_CONTAINER const &targetRegions, LAMBDA &&lambda)
This function is used to launch kernel function over the specified target element subregions with the...