Skip to content

Commit 2bf2c4a

Browse files
authored
damping faces/elements consistency (#2758)
* damping faces/elements consistency
1 parent abb3b2c commit 2bf2c4a

6 files changed

+121
-126
lines changed

src/coreComponents/physicsSolvers/wavePropagation/AcousticFirstOrderWaveEquationSEMKernel.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct PrecomputeSourceAndReceiverKernel
4141
* @param[in] size the number of cells in the subRegion
4242
* @param[in] numNodesPerElem number of nodes per element
4343
* @param[in] numFacesPerElem number of faces per element
44-
* @param[in] X coordinates of the nodes
44+
* @param[in] nodeCoords coordinates of the nodes
4545
* @param[in] elemGhostRank rank of the ghost element
4646
* @param[in] elemsToNodes map from element to nodes
4747
* @param[in] elemsToFaces map from element to faces
@@ -70,7 +70,7 @@ struct PrecomputeSourceAndReceiverKernel
7070
localIndex const regionIndex,
7171
localIndex const numNodesPerElem,
7272
localIndex const numFacesPerElem,
73-
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X,
73+
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords,
7474
arrayView1d< integer const > const elemGhostRank,
7575
arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elemsToNodes,
7676
arrayView2d< localIndex const > const elemsToFaces,
@@ -127,7 +127,7 @@ struct PrecomputeSourceAndReceiverKernel
127127

128128
WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords,
129129
elemsToNodes[k],
130-
X,
130+
nodeCoords,
131131
coordsOnRefElem );
132132

133133
sourceIsAccessible[isrc] = 1;
@@ -175,7 +175,7 @@ struct PrecomputeSourceAndReceiverKernel
175175
{
176176
WaveSolverUtils::computeCoordinatesOnReferenceElement< FE_TYPE >( coords,
177177
elemsToNodes[k],
178-
X,
178+
nodeCoords,
179179
coordsOnRefElem );
180180
receiverIsLocal[ircv] = 1;
181181
rcvElem[ircv] = k;
@@ -211,7 +211,7 @@ struct MassMatrixKernel
211211
* @tparam EXEC_POLICY the execution policy
212212
* @tparam ATOMIC_POLICY the atomic policy
213213
* @param[in] size the number of cells in the subRegion
214-
* @param[in] X coordinates of the nodes
214+
* @param[in] nodeCoords coordinates of the nodes
215215
* @param[in] elemsToNodes map from element to nodes
216216
* @param[in] velocity cell-wise velocity
217217
* @param[in] density cell-wise density
@@ -220,7 +220,7 @@ struct MassMatrixKernel
220220
template< typename EXEC_POLICY, typename ATOMIC_POLICY >
221221
void
222222
launch( localIndex const size,
223-
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X,
223+
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords,
224224
arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes,
225225
arrayView1d< real32 const > const velocity,
226226
arrayView1d< real32 const > const density,
@@ -239,7 +239,7 @@ struct MassMatrixKernel
239239
{
240240
for( localIndex i = 0; i < 3; ++i )
241241
{
242-
xLocal[a][i] = X( elemsToNodes( k, a ), i );
242+
xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i );
243243
}
244244
}
245245

@@ -337,7 +337,7 @@ struct VelocityComputation
337337
* @tparam EXEC_POLICY the execution policy
338338
* @tparam ATOMIC_POLICY the atomic policy
339339
* @param[in] size the number of cells in the subRegion
340-
* @param[in] X coordinates of the nodes
340+
* @param[in] nodeCoords coordinates of the nodes
341341
* @param[in] elemsToNodes map from element to nodes
342342
* @param[in] p_np1 pressure array (only used here)
343343
* @param[in] dt time-step
@@ -348,7 +348,7 @@ struct VelocityComputation
348348
template< typename EXEC_POLICY, typename ATOMIC_POLICY >
349349
void
350350
launch( localIndex const size,
351-
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X,
351+
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords,
352352
arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes,
353353
arrayView1d< real32 const > const p_np1,
354354
arrayView1d< real32 const > const density,
@@ -367,7 +367,7 @@ struct VelocityComputation
367367
{
368368
for( localIndex i=0; i<3; ++i )
369369
{
370-
xLocal[a][i] = X( elemsToNodes( k, a ), i );
370+
xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i );
371371
}
372372
}
373373

@@ -447,7 +447,7 @@ struct PressureComputation
447447
* @param[in] size the number of cells in the subRegion
448448
* @param[in] regionIndex Index of the subregion
449449
* @param[in] size_node the number of nodes in the subRegion
450-
* @param[in] X coordinates of the nodes
450+
* @param[in] nodeCoords coordinates of the nodes
451451
* @param[in] elemsToNodes map from element to nodes
452452
* @param[out] velocity_x velocity array in the x direction (only used here)
453453
* @param[out] velocity_y velocity array in the y direction (only used here)
@@ -468,7 +468,7 @@ struct PressureComputation
468468
launch( localIndex const size,
469469
localIndex const regionIndex,
470470
localIndex const size_node,
471-
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const X,
471+
arrayView2d< WaveSolverBase::wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords,
472472
arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes,
473473
arrayView2d< real32 const > const velocity_x,
474474
arrayView2d< real32 const > const velocity_y,
@@ -502,7 +502,7 @@ struct PressureComputation
502502
{
503503
for( localIndex i=0; i<3; ++i )
504504
{
505-
xLocal[a][i] = X( elemsToNodes( k, a ), i );
505+
xLocal[a][i] = nodeCoords( elemsToNodes( k, a ), i );
506506
}
507507
}
508508

src/coreComponents/physicsSolvers/wavePropagation/AcousticVTIWaveEquationSEM.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups()
244244

245245
/// get the array of indicators: 1 if the face is on the boundary; 0 otherwise
246246
arrayView1d< integer > const & facesDomainBoundaryIndicator = faceManager.getDomainBoundaryIndicator();
247-
arrayView2d< wsCoordType const, nodes::REFERENCE_POSITION_USD > const X32 =
247+
arrayView2d< wsCoordType const, nodes::REFERENCE_POSITION_USD > const nodeCoords =
248248
nodeManager.getField< fields::referencePosition32 >().toViewConst();
249249

250250
/// get face to node map
@@ -273,7 +273,7 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups()
273273
{
274274

275275
arrayView2d< localIndex const, cells::NODE_MAP_USD > const elemsToNodes = elementSubRegion.nodeList();
276-
arrayView2d< localIndex const > const facesToElements = faceManager.elementList();
276+
arrayView2d< localIndex const > const elemsToFaces = elementSubRegion.faceList();
277277
arrayView1d< real32 const > const velocity = elementSubRegion.getField< fields::wavesolverfields::MediumVelocity >();
278278
arrayView1d< real32 const > const epsilon = elementSubRegion.getField< fields::wavesolverfields::Epsilon >();
279279
arrayView1d< real32 const > const delta = elementSubRegion.getField< fields::wavesolverfields::Delta >();
@@ -288,16 +288,16 @@ void AcousticVTIWaveEquationSEM::initializePostInitialConditionsPreSubGroups()
288288
acousticVTIWaveEquationSEMKernels::MassMatrixKernel< FE_TYPE > kernelM( finiteElement );
289289

290290
kernelM.template launch< EXEC_POLICY, ATOMIC_POLICY >( elementSubRegion.size(),
291-
X32,
291+
nodeCoords,
292292
elemsToNodes,
293293
velocity,
294294
mass );
295295

296296
acousticVTIWaveEquationSEMKernels::DampingMatrixKernel< FE_TYPE > kernelD( finiteElement );
297297

298-
kernelD.template launch< EXEC_POLICY, ATOMIC_POLICY >( faceManager.size(),
299-
X32,
300-
facesToElements,
298+
kernelD.template launch< EXEC_POLICY, ATOMIC_POLICY >( elementSubRegion.size(),
299+
nodeCoords,
300+
elemsToFaces,
301301
facesToNodes,
302302
facesDomainBoundaryIndicator,
303303
freeSurfaceFaceIndicator,

0 commit comments

Comments
 (0)