MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / computeLocalIntegration

Method computeLocalIntegration

src/Solver/time_stepping/TimeCluster.cpp:352–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void seissol::time_stepping::TimeCluster::computeLocalIntegration(seissol::initializer::Layer& i_layerData, bool resetBuffers ) {
353 SCOREP_USER_REGION( "computeLocalIntegration", SCOREP_USER_REGION_TYPE_FUNCTION )
354
355 m_loopStatistics->begin(m_regionComputeLocalIntegration);
356
357 // local integration buffer
358 alignas(Alignment) real l_integrationBuffer[tensor::I::size()];
359
360 // pointer for the call of the ADER-function
361 real* l_bufferPointer;
362
363 real** buffers = i_layerData.var(m_lts->buffers);
364 real** derivatives = i_layerData.var(m_lts->derivatives);
365 CellMaterialData* materialData = i_layerData.var(m_lts->material);
366
367 kernels::LocalData::Loader loader;
368 loader.load(*m_lts, i_layerData);
369 kernels::LocalTmp tmp(seissolInstance.getGravitationSetup().acceleration);
370
371#ifdef _OPENMP
372 #pragma omp parallel for private(l_bufferPointer, l_integrationBuffer), firstprivate(tmp) schedule(static)
373#endif
374 for (unsigned int l_cell = 0; l_cell < i_layerData.getNumberOfCells(); l_cell++) {
375 auto data = loader.entry(l_cell);
376
377 // We need to check, whether we can overwrite the buffer or if it is
378 // needed by some other time cluster.
379 // If we cannot overwrite the buffer, we compute everything in a temporary
380 // local buffer and accumulate the results later in the shared buffer.
381 const bool buffersProvided = (data.cellInformation().ltsSetup >> 8) % 2 == 1; // buffers are provided
382 const bool resetMyBuffers = buffersProvided && ( (data.cellInformation().ltsSetup >> 10) %2 == 0 || resetBuffers ); // they should be reset
383
384 if (resetMyBuffers) {
385 // assert presence of the buffer
386 assert(buffers[l_cell] != nullptr);
387
388 l_bufferPointer = buffers[l_cell];
389 } else {
390 // work on local buffer
391 l_bufferPointer = l_integrationBuffer;
392 }
393
394 m_timeKernel.computeAder(timeStepSize(),
395 data,
396 tmp,
397 l_bufferPointer,
398 derivatives[l_cell],
399 true);
400
401 // Compute local integrals (including some boundary conditions)
402 CellBoundaryMapping (*boundaryMapping)[4] = i_layerData.var(m_lts->boundaryMapping);
403 m_localKernel.computeIntegral(l_bufferPointer,
404 data,
405 tmp,
406 &materialData[l_cell],
407 &boundaryMapping[l_cell],
408 ct.correctionTime,
409 timeStepSize()

Callers

nothing calls this directly

Calls 9

sizeFunction · 0.85
CellBoundaryMappingClass · 0.85
loadMethod · 0.80
beginMethod · 0.45
varMethod · 0.45
getNumberOfCellsMethod · 0.45
computeAderMethod · 0.45
computeIntegralMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected