Skip to content

Commit

Permalink
LvArray update. (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
corbett5 authored Nov 20, 2020
1 parent 851b611 commit ecaa0f2
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 90 deletions.
2 changes: 1 addition & 1 deletion src/coreComponents/LvArray
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TEST( LinearElasticAnisotropicTests, testAllocation )
// arrayView1d<LinearElasticAnisotropic::StiffnessTensor const> const &
// stiffness = cm.stiffness() ;

arrayView3d< real64 const, solid::STRESS_USD > const & stress = cm.getStress().toViewConst();
arrayView3d< real64 const, solid::STRESS_USD > const & stress = cm.getStress();

// EXPECT_EQ( stiffness.size(), numElems );
EXPECT_EQ( stress.size( 0 ), numElems );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ TEST( LinearElasticIsotropicTests, testAllocation )
EXPECT_EQ( cm.size(), numElems );
EXPECT_EQ( cm.numQuadraturePoints(), numQuadraturePoints );

arrayView1d< real64 const > const bulkModulus = cm.bulkModulus().toViewConst();
arrayView1d< real64 const > const shearModulus = cm.shearModulus().toViewConst();
arrayView3d< real64 const, solid::STRESS_USD > const stress = cm.getStress().toViewConst();
arrayView1d< real64 const > const bulkModulus = cm.bulkModulus();
arrayView1d< real64 const > const shearModulus = cm.shearModulus();
arrayView3d< real64 const, solid::STRESS_USD > const stress = cm.getStress();

EXPECT_EQ( bulkModulus.size(), numElems );
EXPECT_EQ( shearModulus.size(), numElems );
Expand Down
24 changes: 12 additions & 12 deletions src/coreComponents/finiteVolume/TwoPointFluxApproximation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void TwoPointFluxApproximation::computeCellStencil( MeshLevel & mesh ) const
ElementRegionManager::ElementViewAccessor< arrayView1d< integer const > > const elemGhostRank =
elemManager.ConstructArrayViewAccessor< integer, 1 >( ObjectManagerBase::viewKeyStruct::ghostRankString );

ArrayOfArraysView< localIndex const > const & faceToNodes = faceManager.nodeList().toViewConst();
ArrayOfArraysView< localIndex const > const faceToNodes = faceManager.nodeList().toViewConst();

// make a list of region indices to be included
SortedArray< localIndex > regionFilter;
Expand Down Expand Up @@ -258,28 +258,28 @@ void TwoPointFluxApproximation::addToFractureStencil( MeshLevel & mesh,
#endif
#if SET_CREATION_DISPLACEMENT==1
ArrayOfArraysView< localIndex const > const & faceToNodesMap = faceManager->nodeList();
arrayView2d< real64, nodes::INCR_DISPLACEMENT_USD > const & incrementalDisplacement = nodeManager->incrementalDisplacement();
arrayView2d< real64, nodes::TOTAL_DISPLACEMENT_USD > const & totalDisplacement = nodeManager->totalDisplacement();
arrayView1d< real64 > const & aperture = fractureSubRegion->getReference< array1d< real64 > >( "elementAperture" );
arrayView2d< real64, nodes::INCR_DISPLACEMENT_USD > const incrementalDisplacement = nodeManager->incrementalDisplacement();
arrayView2d< real64, nodes::TOTAL_DISPLACEMENT_USD > const totalDisplacement = nodeManager->totalDisplacement();
arrayView1d< real64 > const aperture = fractureSubRegion->getReference< array1d< real64 > >( "elementAperture" );
#endif


#ifdef GEOSX_USE_SEPARATION_COEFFICIENT
arrayView1d< real64 > const & apertureF = fractureSubRegion->getReference< array1d< real64 > >( "apertureAtFailure" );
arrayView1d< real64 > const apertureF = fractureSubRegion->getReference< array1d< real64 > >( "apertureAtFailure" );
#endif

#if !defined(ALLOW_CREATION_MASS)
static_assert( true, "must have ALLOW_CREATION_MASS defined" );
#endif
#if ALLOW_CREATION_MASS==0
arrayView1d< real64 > const & dens = fractureSubRegion->getReference< array1d< real64 > >( "densityOld" );
arrayView1d< real64 > const dens = fractureSubRegion->getReference< array1d< real64 > >( "densityOld" );
#endif


#if SET_CREATION_PRESSURE==1
arrayView1d< real64 > const & fluidPressure = fractureSubRegion->getReference< array1d< real64 > >( "pressure" );
arrayView1d< real64 > const fluidPressure = fractureSubRegion->getReference< array1d< real64 > >( "pressure" );
// Set the new face elements to some unphysical numbers to make sure they get set by the following routines.
SortedArrayView< localIndex const > const & newFaceElements = fractureSubRegion->m_newFaceElements.toViewConst();
SortedArrayView< localIndex const > const newFaceElements = fractureSubRegion->m_newFaceElements.toViewConst();
forAll< serialPolicy >( fractureSubRegion->m_newFaceElements.size(), [=]( localIndex const k )
{
localIndex const kfe = newFaceElements[k];
Expand Down Expand Up @@ -310,7 +310,7 @@ void TwoPointFluxApproximation::addToFractureStencil( MeshLevel & mesh,
SortedArray< localIndex > allNewElems;
allNewElems.insert( fractureSubRegion->m_newFaceElements.begin(),
fractureSubRegion->m_newFaceElements.end() );
SortedArrayView< localIndex const > const &
SortedArrayView< localIndex const > const
recalculateFractureConnectorEdges = edgeManager->m_recalculateFractureConnectorEdges.toViewConst();

// add new connectors/connections between face elements to the fracture stencil
Expand Down Expand Up @@ -631,7 +631,7 @@ void TwoPointFluxApproximation::addEDFracToFractureStencil( MeshLevel & mesh,
EmbeddedSurfaceSubRegion >( "embeddedSurfaceSubRegion" ) );

// arrayView1d< real64 const > const & fractureElemArea = fractureSubRegion->getElementArea();
arrayView2d< real64 const > const fractureElemCenter = fractureSubRegion.getElementCenter().toViewConst();
arrayView2d< real64 const > const fractureElemCenter = fractureSubRegion.getElementCenter();
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const X = nodeManager.embSurfNodesPosition();

EdgeManager::FaceMapType const & edgeToEmbSurfacesMap = embSurfEdgeManager.faceList();
Expand Down Expand Up @@ -704,7 +704,7 @@ void TwoPointFluxApproximation::addEDFracToFractureStencil( MeshLevel & mesh,

FixedToManyElementRelation const & surfaceElementsToCells = fractureSubRegion.getToCellRelation();

arrayView1d< real64 const > const & connectivityIndex = fractureSubRegion.getConnectivityIndex();
arrayView1d< real64 const > const connectivityIndex = fractureSubRegion.getConnectivityIndex();

ElementRegionManager::ElementViewAccessor< arrayView1d< R1Tensor const > > const permeabilityTensor =
elemManager.ConstructArrayViewAccessor< R1Tensor, 1 >( m_coeffName );
Expand Down Expand Up @@ -788,7 +788,7 @@ void TwoPointFluxApproximation::computeBoundaryStencil( MeshLevel & mesh,
ElementRegionManager::ElementViewAccessor< arrayView1d< R1Tensor const > > const coefficient =
elemManager.ConstructArrayViewAccessor< R1Tensor, 1 >( m_coeffName );

ArrayOfArraysView< localIndex const > const & faceToNodes = faceManager.nodeList().toViewConst();
ArrayOfArraysView< localIndex const > const faceToNodes = faceManager.nodeList().toViewConst();

// make a list of region indices to be included
SortedArray< localIndex > regionFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TEST_F( LAIHelperFunctionsTest, Test_NodalVectorPermutation )
MeshLevel * const meshLevel = domain->getMeshBody( 0 )->getMeshLevel( 0 );
NodeManager * const nodeManager = meshLevel->getNodeManager();

arrayView1d< globalIndex const > const nodeLocalToGlobal = nodeManager->localToGlobalMap().toViewConst();
arrayView1d< globalIndex const > const nodeLocalToGlobal = nodeManager->localToGlobalMap();

DofManager dofManager( "test" );
dofManager.setMesh( *domain, 0, 0 );
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/managers/unitTests/testMeshGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ TEST_F( MeshGenerationTest, nodePositions )

TEST_F( MeshGenerationTest, elementCentersAndVolumes )
{
arrayView2d< real64 const > const centers = m_subRegion->getElementCenter().toViewConst();
arrayView1d< real64 const > const volumes = m_subRegion->getElementVolume().toViewConst();
arrayView2d< real64 const > const centers = m_subRegion->getElementCenter();
arrayView1d< real64 const > const volumes = m_subRegion->getElementVolume();

constexpr double VOLUME = dx * dy * dz;

Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/mesh/CellElementRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ void CellElementRegion::GenerateAggregates( FaceManager const * const faceManage
// Third, normalize the centers
this->forElementSubRegions< CellElementSubRegion, FaceElementSubRegion >( [&]( ElementSubRegionBase & elementSubRegion )
{
arrayView1d< integer const > const ghostRank = elementSubRegion.ghostRank().toViewConst();
arrayView1d< integer const > const ghostRank = elementSubRegion.ghostRank();
localIndex const subRegionIndex = elementSubRegion.getIndexInParent();
arrayView2d< real64 const > const elemCenter = elementSubRegion.getElementCenter().toViewConst();
arrayView2d< real64 const > const elemCenter = elementSubRegion.getElementCenter();

for( localIndex cellIndex = 0; cellIndex< elementSubRegion.size(); cellIndex++ )
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/mesh/CellElementSubRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void CellElementSubRegion::CopyFromCellBlock( CellBlock * source )
this->resize( source->size());
this->nodeList() = source->nodeList();

arrayView1d< globalIndex const > const sourceLocalToGlobal = source->localToGlobalMap().toViewConst();
arrayView1d< globalIndex const > const sourceLocalToGlobal = source->localToGlobalMap();
this->m_localToGlobalMap.resize( sourceLocalToGlobal.size() );
for( localIndex i = 0; i < localToGlobalMap().size(); ++i )
{
Expand Down
8 changes: 4 additions & 4 deletions src/coreComponents/mesh/EdgeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void EdgeManager::BuildEdges( FaceManager * const faceManager, NodeManager * con

localIndex const numNodes = nodeManager->size();

ArrayOfArraysView< localIndex const > const & faceToNodeMap = faceManager->nodeList().toViewConst();
ArrayOfArraysView< localIndex const > const faceToNodeMap = faceManager->nodeList().toViewConst();

faceManager->edgeList().SetRelatedObject( this );
ArrayOfArrays< localIndex > & faceToEdgeMap = faceManager->edgeList();
Expand Down Expand Up @@ -444,7 +444,7 @@ void EdgeManager::BuildEdges( FaceManager * const faceManager, NodeManager * con
{
auto const & setWrapper = nodeSets[i];
std::string const & setName = setWrapper->getName();
SortedArrayView< localIndex const > const & targetSet = nodeManager->sets().getReference< SortedArray< localIndex > >( setName ).toViewConst();
SortedArrayView< localIndex const > const targetSet = nodeManager->sets().getReference< SortedArray< localIndex > >( setName ).toViewConst();
ConstructSetFromSetAndMap( targetSet, m_toNodesRelation, setName );
} );

Expand Down Expand Up @@ -646,7 +646,7 @@ void EdgeManager::ExtractMapFromObjectForAssignGlobalIndexNumbers( ObjectManager
localIndex const numEdges = size();

arrayView2d< localIndex const > const edgeNodes = this->nodeList();
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator().toViewConst();
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator();

globalEdgeNodes.resize( numEdges );

Expand Down Expand Up @@ -747,7 +747,7 @@ void EdgeManager::ConnectivityFromGlobalToLocal( const SortedArray< localIndex >
void EdgeManager::AddToEdgeToFaceMap( FaceManager const * const faceManager,
arrayView1d< localIndex const > const & newFaceIndices )
{
ArrayOfArraysView< localIndex const > const & faceToEdgeMap = faceManager->edgeList().toViewConst();
ArrayOfArraysView< localIndex const > const faceToEdgeMap = faceManager->edgeList().toViewConst();

// loop over all faces in list
for( localIndex const newFaceIndex : newFaceIndices )
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/mesh/FaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void FaceManager::SetDomainBoundaryObjects( NodeManager * const nodeManager )

void FaceManager::SetIsExternal()
{
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator().toViewConst();
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator();

m_isExternal.setValues< serialPolicy >( 0 );
for( localIndex k=0; k<size(); ++k )
Expand Down Expand Up @@ -804,7 +804,7 @@ void FaceManager::ExtractMapFromObjectForAssignGlobalIndexNumbers( ObjectManager
localIndex const numFaces = size();

ArrayOfArraysView< localIndex const > const faceToNodeMap = this->nodeList().toViewConst();
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator().toViewConst();
arrayView1d< integer const > const isDomainBoundary = this->getDomainBoundaryIndicator();

globalFaceNodes.resize( numFaces );

Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/mesh/deprecated/FaceElementRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ localIndex FaceElementRegion::AddToFractureMesh( real64 const time_np1,

arrayView2d< real64 const > const faceCenter = faceManager->faceCenter();
arrayView2d< real64 > const elemCenter = subRegion->getElementCenter();
arrayView1d< real64 const > const elemArea = subRegion->getElementArea().toViewConst();
arrayView1d< real64 const > const elemArea = subRegion->getElementArea();

arrayView1d< integer > const subRegionGhostRank = subRegion->ghostRank();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void TestMeshImport( string const & inputStringMesh,
[&]( localIndex const er, localIndex const esr, ElementRegionBase &, ElementSubRegionBase & elemSubRegion )
{
elemSubRegion.CalculateElementGeometricQuantities( nodeManager, faceManager );
arrayView2d< real64 const > const elemCenter = elemSubRegion.getElementCenter().toViewConst();
arrayView2d< real64 const > const elemCenter = elemSubRegion.getElementCenter();
for( localIndex ei = 0; ei < elemSubRegion.size(); ei++ )
{
real64 center[ 3 ] = LVARRAY_TENSOROPS_INIT_LOCAL_3( elemCenter[ ei ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void FlowSolverBase::PrecomputeData( MeshLevel & mesh )
forTargetSubRegions( mesh, [&]( localIndex const,
ElementSubRegionBase & subRegion )
{
arrayView2d< real64 const > const elemCenter = subRegion.getElementCenter().toViewConst();
arrayView2d< real64 const > const elemCenter = subRegion.getElementCenter();

arrayView1d< real64 > const gravityCoef =
subRegion.getReference< array1d< real64 > >( viewKeyStruct::gravityCoefString );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void WellSolverBase::PrecomputeData( DomainPartition & domain )
{
PerforationData * const perforationData = subRegion.GetPerforationData();

arrayView2d< real64 const > const wellElemLocation = subRegion.getElementCenter().toViewConst();
arrayView2d< real64 const > const wellElemLocation = subRegion.getElementCenter();

arrayView1d< real64 > const wellElemGravCoef =
subRegion.getReference< array1d< real64 > >( viewKeyStruct::gravityCoefString );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void HydrofractureSolver::UpdateDeformationForCoupling( DomainPartition & domain
arrayView1d< real64 > const effectiveAperture = subRegion.getReference< array1d< real64 > >( FlowSolverBase::viewKeyStruct::effectiveApertureString );
arrayView1d< real64 const > const volume = subRegion.getElementVolume();
arrayView1d< real64 > const deltaVolume = subRegion.getReference< array1d< real64 > >( FlowSolverBase::viewKeyStruct::deltaVolumeString );
arrayView1d< real64 const > const area = subRegion.getElementArea().toViewConst();
arrayView1d< real64 const > const area = subRegion.getElementArea();
arrayView2d< localIndex const > const elemsToFaces = subRegion.faceList();

#ifdef GEOSX_USE_SEPARATION_COEFFICIENT
Expand Down Expand Up @@ -889,7 +889,7 @@ HydrofractureSolver::

globalIndex const rankOffset = m_dofManager.rankOffset();

CRSMatrixView< real64 const, localIndex const > const &
CRSMatrixView< real64 const, localIndex const > const
dFluxResidual_dAperture = m_flowSolver->getDerivativeFluxResidual_dAperture().toViewConst();

ContactRelationBase const * const
Expand Down
Loading

0 comments on commit ecaa0f2

Please sign in to comment.