Skip to content

Commit

Permalink
Fixed compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
DENEL Bertrand committed Dec 11, 2024
1 parent e706287 commit 44e9eed
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 77 deletions.
2 changes: 1 addition & 1 deletion inputFiles/wavePropagation/acous3D_vti_smoke.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<!-- define the source coordinates -->
<!-- define the time source frequency -->
<!-- define the receiver coordinates -->
<AcousticVTISEM
<AcousticVTIFletcherSEM
name="acousticSolver"
cflFactor="0.25"
discretization="FE1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

/**
* @file AcousticVTIFletcherWaveEquationSEMKernel.hpp
* @file AcousticVTIFletcherAdjointWaveEquationSEMKernel.hpp
*/

#ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICVTIFLETCHERADJOINTWAVEEQUATIONSEMKERNEL_HPP_
Expand All @@ -32,7 +32,7 @@ namespace geos
{

/// Namespace to contain the acoustic wave kernels.
namespace acousticVTIFletcherWaveEquationSEMKernels
namespace acousticVTIFletcherAdjointWaveEquationSEMKernels
{

/**
Expand All @@ -55,7 +55,7 @@ namespace acousticVTIFletcherWaveEquationSEMKernels
template< typename SUBREGION_TYPE,
typename CONSTITUTIVE_TYPE,
typename FE_TYPE >
class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
class ExplicitAcousticVTIFletcherAdjointSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
CONSTITUTIVE_TYPE,
FE_TYPE,
1,
Expand Down Expand Up @@ -93,7 +93,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
* @param dt The time interval for the step.
* elements to be processed during this kernel launch.
*/
ExplicitAcousticSEM( NodeManager & nodeManager,
ExplicitAcousticVTIFletcherAdjointSEM( NodeManager & nodeManager,
EdgeManager const & edgeManager,
FaceManager const & faceManager,
localIndex const targetRegionIndex,
Expand All @@ -105,14 +105,14 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
finiteElementSpace,
inputConstitutiveType ),
m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ),
m_p_n( nodeManager.getField< acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< acousticvtifields::AcousticDelta >() ),
m_vti_sigma( elementSubRegion.template getField< acousticvtifields::AcousticSigma >() ),
m_p_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< geos::fields::acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticDelta >() ),
m_vti_sigma( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticSigma >() ),
m_dt( dt )
{
GEOS_UNUSED_VAR( edgeManager );
Expand Down Expand Up @@ -276,7 +276,7 @@ using ExplicitAcousticVTIFletcherAdjointSEMFactory = finiteElement::KernelFactor
real64 >;


} // namespace acousticVTIFletcherWaveEquationSEMKernels
} // namespace acousticVTIFletcherAdjointWaveEquationSEMKernels

} // namespace geos

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ real64 AcousticVTIFletcherWaveEquationSEM::computeTimeStep( real64 & dtOut )
{
// TODO: adapt to VTI
GEOS_ERROR( "This option (Time Step computation) is not supported" );
dtOut = 0.;

return m_timeStep * m_cflFactor;

}


Expand All @@ -391,14 +395,14 @@ void AcousticVTIFletcherWaveEquationSEM::precomputeSurfaceFieldIndicator( Domain
ArrayOfArraysView< localIndex const > const faceToNodeMap = faceManager.nodeList().toViewConst();

/// array of indicators: 1 if a face is on on lateral surface; 0 otherwise
arrayView1d< localIndex > const lateralSurfaceFaceIndicator = faceManager.getField< acoustivtifields::AcousticLateralSurfaceFaceIndicator >();
arrayView1d< localIndex > const lateralSurfaceFaceIndicator = faceManager.getField< acousticvtifields::AcousticLateralSurfaceFaceIndicator >();
/// array of indicators: 1 if a node is on on lateral surface; 0 otherwise
arrayView1d< localIndex > const lateralSurfaceNodeIndicator = nodeManager.getField< acoustivtifields::AcousticLateralSurfaceNodeIndicator >();
arrayView1d< localIndex > const lateralSurfaceNodeIndicator = nodeManager.getField< acousticvtifields::AcousticLateralSurfaceNodeIndicator >();

/// array of indicators: 1 if a face is on on bottom surface; 0 otherwise
arrayView1d< localIndex > const bottomSurfaceFaceIndicator = faceManager.getField< acoustivtifields::AcousticBottomSurfaceFaceIndicator >();
arrayView1d< localIndex > const bottomSurfaceFaceIndicator = faceManager.getField< acousticvtifields::AcousticBottomSurfaceFaceIndicator >();
/// array of indicators: 1 if a node is on on bottom surface; 0 otherwise
arrayView1d< localIndex > const bottomSurfaceNodeIndicator = nodeManager.getField< acoustivtifields::AcousticBottomSurfaceNodeIndicator >();
arrayView1d< localIndex > const bottomSurfaceNodeIndicator = nodeManager.getField< acousticvtifields::AcousticBottomSurfaceNodeIndicator >();

// Lateral surfaces
fsManager.apply< FaceManager >( time,
Expand Down Expand Up @@ -544,8 +548,9 @@ void AcousticVTIFletcherWaveEquationSEM::initializePML()

void AcousticVTIFletcherWaveEquationSEM::applyPML( real64 const time, DomainPartition & domain )
{
GEOS_UNUSED_VAR(time, domain);
GEOS_MARK_FUNCTION;

#if 0
FieldSpecificationManager & fsManager = FieldSpecificationManager::getInstance();
parametersPML const & param = getReference< parametersPML >( viewKeyStruct::parametersPMLString() );

Expand Down Expand Up @@ -617,6 +622,7 @@ void AcousticVTIFletcherWaveEquationSEM::applyPML( real64 const time, DomainPart
using FE_TYPE = TYPEOFREF( finiteElement );

/// apply the PML kernel

AcousticPMLSEM::
PMLKernel< FE_TYPE > kernel( finiteElement );
kernel.template launch< EXEC_POLICY, ATOMIC_POLICY >
Expand All @@ -636,10 +642,11 @@ void AcousticVTIFletcherWaveEquationSEM::applyPML( real64 const time, DomainPart
r,
grad_n,
divV_n );

} );
} );
} );

#endif
}

real64 AcousticVTIFletcherWaveEquationSEM::explicitStepForward( real64 const & time_n,
Expand Down Expand Up @@ -687,7 +694,7 @@ real64 AcousticVTIFletcherWaveEquationSEM::explicitStepBackward( real64 const &
forDiscretizationOnMeshTargets( domain.getMeshBodies(),
[&] ( string const &,
MeshLevel & mesh,
arrayView1d< string const > const & regionNames )
arrayView1d< string const > const & GEOS_UNUSED_PARAM( regionNames ) )
{
NodeManager & nodeManager = mesh.getNodeManager();

Expand All @@ -705,6 +712,7 @@ real64 AcousticVTIFletcherWaveEquationSEM::explicitStepBackward( real64 const &
EventManager const & event = getGroupByPath< EventManager >( "/Problem/Events" );
real64 const & maxTime = event.getReference< real64 >( EventManager::viewKeyStruct::maxTimeString() );
int const maxCycle = int(round( maxTime / dt ));
GEOS_UNUSED_VAR(maxCycle);

if( computeGradient && cycleNumber >= 0 )
{
Expand Down Expand Up @@ -752,7 +760,7 @@ void AcousticVTIFletcherWaveEquationSEM::prepareNextTimestep( MeshLevel & mesh )

void AcousticVTIFletcherWaveEquationSEM::computeUnknowns( real64 const & time_n,
real64 const & dt,
DomainPartition & domain,
DomainPartition & GEOS_UNUSED_PARAM( domain),
MeshLevel & mesh,
arrayView1d< string const > const & regionNames,
bool const isForward )
Expand All @@ -773,10 +781,6 @@ void AcousticVTIFletcherWaveEquationSEM::computeUnknowns( real64 const & time_n,
arrayView1d< real32 > const q_n = nodeManager.getField< acousticvtifields::Pressure_q_n >();
arrayView1d< real32 > const q_np1 = nodeManager.getField< acousticvtifields::Pressure_q_np1 >();

arrayView1d< real32 > const p_nm1 = nodeManager.getField< acousticfields::Pressure_nm1 >();
arrayView1d< real32 > const p_n = nodeManager.getField< acousticfields::Pressure_n >();
arrayView1d< real32 > const p_np1 = nodeManager.getField< acousticfields::Pressure_np1 >();

arrayView1d< localIndex const > const freeSurfaceNodeIndicator = nodeManager.getField< acousticfields::AcousticFreeSurfaceNodeIndicator >();
arrayView1d< localIndex const > const lateralSurfaceNodeIndicator = nodeManager.getField< acousticvtifields::AcousticLateralSurfaceNodeIndicator >();
arrayView1d< localIndex const > const bottomSurfaceNodeIndicator = nodeManager.getField< acousticvtifields::AcousticBottomSurfaceNodeIndicator >();
Expand Down Expand Up @@ -813,14 +817,12 @@ if( isForward )
//Modification of cycleNember useful when minTime < 0
addSourceToRightHandSide( time_n, rhs );

/// calculate your time integrators
real64 const dt2 = pow( dt, 2 );

SortedArrayView< localIndex const > const solverTargetNodesSet = m_solverTargetNodesSet.toViewConst();
if( !m_usePML )
{
GEOS_MARK_SCOPE ( updateP );
AcousticTimeSchemeSEM::LeapFrogWithoutPML( dt, p_np1, p_n, p_nm1, mass, stiffnessVector, damping,
AcousticTimeSchemeSEM::LeapFrogWithoutPML( dt, p_np1, p_n, p_nm1, mass, stiffnessVector_p, damping_pp,
rhs, freeSurfaceNodeIndicator, solverTargetNodesSet );
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class AcousticVTIFletcherWaveEquationSEM : public WaveSolverBase
*/
virtual void applyPML( real64 const time, DomainPartition & domain ) override;

void precomputeSurfaceFieldIndicator( DomainPartition & domain );

/// Pressure_np1 at the receiver location for each time step for each receiver
array2d< real32 > m_pressureNp1AtReceivers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ namespace acousticVTIFletcherWaveEquationSEMKernels
template< typename SUBREGION_TYPE,
typename CONSTITUTIVE_TYPE,
typename FE_TYPE >
class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
class ExplicAcousticVTIFletcherWaveEquationSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
CONSTITUTIVE_TYPE,
FE_TYPE,
1,
1 >
{
public:

/// Alias for the base class;
using Base = finiteElement::KernelBase< SUBREGION_TYPE,
CONSTITUTIVE_TYPE,
Expand All @@ -81,6 +80,8 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
using Base::m_elemGhostRank;
using Base::m_constitutiveUpdate;
using Base::m_finiteElementSpace;



//*****************************************************************************
/**
Expand All @@ -93,7 +94,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
* @param dt The time interval for the step.
* elements to be processed during this kernel launch.
*/
ExplicitAcousticSEM( NodeManager & nodeManager,
ExplicAcousticVTIFletcherWaveEquationSEM ( NodeManager & nodeManager,
EdgeManager const & edgeManager,
FaceManager const & faceManager,
localIndex const targetRegionIndex,
Expand All @@ -105,14 +106,14 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
finiteElementSpace,
inputConstitutiveType ),
m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ),
m_p_n( nodeManager.getField< acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< acousticvtifields::AcousticDelta >() ),
m_vti_sigma( elementSubRegion.template getField< acousticvtifields::AcousticSigma >() ),
m_p_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< geos::fields::acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticDelta >() ),
m_vti_sigma( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticSigma >() ),
m_dt( dt )
{
GEOS_UNUSED_VAR( edgeManager );
Expand Down Expand Up @@ -267,7 +268,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,


/// The factory used to construct a ExplicitAcousticVTIFletcher kernel.
using ExplicitAcousticVTIFletcherSEMFactory = finiteElement::KernelFactory< ExplicitAcousticVTIFletcherSEM,
using ExplicitAcousticVTIFletcherSEMFactory = finiteElement::KernelFactory< ExplicAcousticVTIFletcherWaveEquationSEM ,
real64 >;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

/**
* @file AcousticVTIZhangWaveEquationSEMKernel.hpp
* @file AcousticVTIZhangAdjointWaveEquationSEMKernel.hpp
*/

#ifndef GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICVTIZHANGADJOINTWAVEEQUATIONSEMKERNEL_HPP_
Expand All @@ -32,7 +32,7 @@ namespace geos
{

/// Namespace to contain the acoustic wave kernels.
namespace acousticVTIZhangWaveEquationSEMKernels
namespace acousticVTIZhangAdjointWaveEquationSEMKernels
{

/**
Expand All @@ -55,7 +55,7 @@ namespace acousticVTIZhangWaveEquationSEMKernels
template< typename SUBREGION_TYPE,
typename CONSTITUTIVE_TYPE,
typename FE_TYPE >
class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
class ExplicitAcousticVTIZhangAdjointSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
CONSTITUTIVE_TYPE,
FE_TYPE,
1,
Expand Down Expand Up @@ -93,7 +93,7 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
* @param dt The time interval for the step.
* elements to be processed during this kernel launch.
*/
ExplicitAcousticSEM( NodeManager & nodeManager,
ExplicitAcousticVTIZhangAdjointSEM( NodeManager & nodeManager,
EdgeManager const & edgeManager,
FaceManager const & faceManager,
localIndex const targetRegionIndex,
Expand All @@ -105,13 +105,13 @@ class ExplicitAcousticSEM : public finiteElement::KernelBase< SUBREGION_TYPE,
finiteElementSpace,
inputConstitutiveType ),
m_nodeCoords( nodeManager.getField< fields::referencePosition32 >() ),
m_p_n( nodeManager.getField< acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< acousticvtifields::AcousticDelta >() ),
m_p_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_p_n >() ),
m_q_n( nodeManager.getField< geos::fields::acousticvtifields::Pressure_q_n >() ),
m_stiffnessVector_p( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_p >() ),
m_stiffnessVector_q( nodeManager.getField< geos::fields::acousticvtifields::StiffnessVector_q >() ),
m_density( elementSubRegion.template getField< geos::fields::acousticfields::AcousticDensity >() ),
m_vti_epsilon( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticEpsilon >() ),
m_vti_delta( elementSubRegion.template getField< geos::fields::acousticvtifields::AcousticDelta >() ),
m_dt( dt )
{
GEOS_UNUSED_VAR( edgeManager );
Expand Down Expand Up @@ -265,7 +265,7 @@ using ExplicitAcousticVTIZhangAdjointSEMFactory = finiteElement::KernelFactory<
real64 >;


} // namespace acousticVTIZhangWaveEquationSEMKernels
} // namespace acousticVTIZhangAdjointWaveEquationSEMKernels

} // namespace geos

Expand Down
Loading

0 comments on commit 44e9eed

Please sign in to comment.