Skip to content

Commit

Permalink
Fix bug when we get the number of degrees of freedom which implies re…
Browse files Browse the repository at this point in the history
…size with 0 as dimension (GEOS-DEV#2239)
  • Loading branch information
acitrain authored Jan 13, 2023
1 parent b0b8753 commit 91c92ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,10 @@ void AcousticWaveEquationSEM::initializePreSubGroups()
localIndex const numSourcesGlobal = m_sourceCoordinates.size( 0 );
m_sourceNodeIds.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstants.resize( numSourcesGlobal, numNodesPerElem );
//m_sourceIsLocal.resize( numSourcesGlobal );

localIndex const numReceiversGlobal = m_receiverCoordinates.size( 0 );
m_receiverNodeIds.resize( numReceiversGlobal, numNodesPerElem );
m_receiverConstants.resize( numReceiversGlobal, numNodesPerElem );
m_receiverIsLocal.resize( numReceiversGlobal );

m_pressureNp1AtReceivers.resizeDimension< 1 >( numReceiversGlobal );



}

Expand Down Expand Up @@ -229,17 +223,10 @@ void AcousticWaveEquationSEM::postProcessInput()
}
localIndex const nsamples = int(maxTime/dt) + 1;


localIndex numNodesPerElem = getNumNodesPerElem();

localIndex const numSourcesGlobal = m_sourceCoordinates.size( 0 );
m_sourceNodeIds.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstants.resize( numSourcesGlobal, numNodesPerElem );
m_sourceIsAccessible.resize( numSourcesGlobal );

localIndex const numReceiversGlobal = m_receiverCoordinates.size( 0 );
m_receiverNodeIds.resize( numReceiversGlobal, numNodesPerElem );
m_receiverConstants.resize( numReceiversGlobal, numNodesPerElem );
m_receiverIsLocal.resize( numReceiversGlobal );

m_pressureNp1AtReceivers.resize( m_nsamplesSeismoTrace, numReceiversGlobal );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,17 @@ void ElasticWaveEquationSEM::initializePreSubGroups()

WaveSolverBase::initializePreSubGroups();

DomainPartition & domain = this->getGroupByPath< DomainPartition >( "/Problem/domain" );

NumericalMethodsManager const & numericalMethodManager = domain.getNumericalMethodManager();
localIndex const numNodesPerElem = getNumNodesPerElem();

FiniteElementDiscretizationManager const &
feDiscretizationManager = numericalMethodManager.getFiniteElementDiscretizationManager();

FiniteElementDiscretization const * const
feDiscretization = feDiscretizationManager.getGroupPointer< FiniteElementDiscretization >( m_discretizationName );
GEOSX_THROW_IF( feDiscretization == nullptr,
getName() << ": FE discretization not found: " << m_discretizationName,
InputError );
localIndex const numSourcesGlobal = m_sourceCoordinates.size( 0 );
m_sourceNodeIds.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsx.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsy.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsz.resize( numSourcesGlobal, numNodesPerElem );

localIndex const numReceiversGlobal = m_receiverCoordinates.size( 0 );
m_receiverNodeIds.resize( numReceiversGlobal, numNodesPerElem );
m_receiverConstants.resize( numReceiversGlobal, numNodesPerElem );

}

Expand Down Expand Up @@ -261,18 +259,10 @@ void ElasticWaveEquationSEM::postProcessInput()
}
localIndex const nsamples = int(maxTime/dt) + 1;

localIndex numNodesPerElem = getNumNodesPerElem();

localIndex const numSourcesGlobal = m_sourceCoordinates.size( 0 );
m_sourceNodeIds.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsx.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsy.resize( numSourcesGlobal, numNodesPerElem );
m_sourceConstantsz.resize( numSourcesGlobal, numNodesPerElem );
m_sourceIsAccessible.resize( numSourcesGlobal );

localIndex const numReceiversGlobal = m_receiverCoordinates.size( 0 );
m_receiverNodeIds.resize( numReceiversGlobal, numNodesPerElem );
m_receiverConstants.resize( numReceiversGlobal, numNodesPerElem );
m_receiverIsLocal.resize( numReceiversGlobal );

m_displacementXNp1AtReceivers.resize( m_nsamplesSeismoTrace, numReceiversGlobal );
Expand Down

0 comments on commit 91c92ec

Please sign in to comment.