Skip to content
Snippets Groups Projects
Commit ad8c87b3 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added springdashpotspring to KernelBenchmark

parent 91e4c363
Branches
Tags
No related merge requests found
...@@ -3,7 +3,7 @@ GranularGas ...@@ -3,7 +3,7 @@ GranularGas
simulationCorner < 0, 0, 0 >; simulationCorner < 0, 0, 0 >;
simulationDomain < 40, 40, 40 >; simulationDomain < 40, 40, 40 >;
blocks < 1,1,1 >; blocks < 1,1,1 >;
isPeriodic < 0, 0, 0 >; isPeriodic < 1, 1, 1 >;
initialRefinementLevel 1; initialRefinementLevel 1;
sorting linear; sorting linear;
shift < 0.01, 0.01, 0.01 >; shift < 0.01, 0.01, 0.01 >;
......
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
#include <mesa_pd/kernel/InsertParticleIntoLinkedCells.h> #include <mesa_pd/kernel/InsertParticleIntoLinkedCells.h>
#include <mesa_pd/kernel/ParticleSelector.h> #include <mesa_pd/kernel/ParticleSelector.h>
#include <mesa_pd/kernel/SpringDashpot.h> #include <mesa_pd/kernel/SpringDashpot.h>
#include <mesa_pd/kernel/SpringDashpotSpring.h>
#include <mesa_pd/mpi/ContactFilter.h> #include <mesa_pd/mpi/ContactFilter.h>
#include <mesa_pd/mpi/ReduceContactHistory.h>
#include <mesa_pd/mpi/ReduceProperty.h> #include <mesa_pd/mpi/ReduceProperty.h>
#include <mesa_pd/mpi/SyncNextNeighbors.h> #include <mesa_pd/mpi/SyncNextNeighbors.h>
#include <mesa_pd/mpi/SyncNextNeighborsBlockForest.h> #include <mesa_pd/mpi/SyncNextNeighborsBlockForest.h>
...@@ -264,12 +266,18 @@ int main( int argc, char ** argv ) ...@@ -264,12 +266,18 @@ int main( int argc, char ** argv )
kernel::ExplicitEulerWithShape explicitEulerWithShape( params.dt ); kernel::ExplicitEulerWithShape explicitEulerWithShape( params.dt );
kernel::AssocToBlock assoc(forest); kernel::AssocToBlock assoc(forest);
kernel::InsertParticleIntoLinkedCells ipilc; kernel::InsertParticleIntoLinkedCells ipilc;
kernel::SpringDashpot dem(1); kernel::SpringDashpot sd(1);
dem.setDampingT (0, 0, real_t(0)); sd.setDampingT (0, 0, real_t(0));
dem.setFriction (0, 0, real_t(0)); sd.setFriction (0, 0, real_t(0));
dem.setParametersFromCOR(0, 0, real_t(0.9), params.dt*real_t(20), ss->shapes[smallSphere]->getMass() * real_t(0.5)); sd.setParametersFromCOR(0, 0, real_t(0.9), params.dt*real_t(20), ss->shapes[smallSphere]->getMass() * real_t(0.5));
kernel::SpringDashpotSpring sds(1);
sds.setParametersFromCOR(0, 0, real_t(0.9), params.dt*real_t(20), ss->shapes[smallSphere]->getMass() * real_t(0.5));
sds.setCoefficientOfFriction(0,0,real_t(0.4));
sds.setStiffnessT(0,0,real_t(0.9) * sds.getStiffnessN(0,0));
mpi::ReduceProperty RP; mpi::ReduceProperty RP;
mpi::SyncNextNeighbors SNN; mpi::SyncNextNeighbors SNN;
mpi::ReduceContactHistory RCH;
ContactDetection CD(domain); ContactDetection CD(domain);
// initial sync // initial sync
...@@ -284,6 +292,17 @@ int main( int argc, char ** argv ) ...@@ -284,6 +292,17 @@ int main( int argc, char ** argv )
WcTimingPool tp; WcTimingPool tp;
LIKWID_MARKER_REGISTER("SNN");
WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("SNN");
tp["SNN"].start();
for (int64_t i=0; i < params.simulationSteps; ++i)
{
SNN(*ps, *domain);
}
tp["SNN"].end();
LIKWID_MARKER_STOP("SNN");
LIKWID_MARKER_REGISTER("AssocToBlock"); LIKWID_MARKER_REGISTER("AssocToBlock");
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("AssocToBlock"); LIKWID_MARKER_START("AssocToBlock");
...@@ -323,19 +342,33 @@ int main( int argc, char ** argv ) ...@@ -323,19 +342,33 @@ int main( int argc, char ** argv )
tp["ContactDetection"].end(); tp["ContactDetection"].end();
LIKWID_MARKER_STOP("ContactDetection"); LIKWID_MARKER_STOP("ContactDetection");
LIKWID_MARKER_REGISTER("DEM"); LIKWID_MARKER_REGISTER("SpringDashpot");
WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("SpringDashpot");
tp["SpringDashpot"].start();
for (int64_t i=0; i < params.simulationSteps; ++i)
{
for (auto& c : CD.getContacts())
{
sd(c.idx1_, c.idx2_, accessor, c.contactPoint_, c.contactNormal_, c.penetrationDepth_);
}
}
tp["SpringDashpot"].end();
LIKWID_MARKER_STOP("SpringDashpot");
LIKWID_MARKER_REGISTER("SpringDashpotSpring");
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("DEM"); LIKWID_MARKER_START("SpringDashpotSpring");
tp["DEM"].start(); tp["SpringDashpotSpring"].start();
for (int64_t i=0; i < params.simulationSteps; ++i) for (int64_t i=0; i < params.simulationSteps; ++i)
{ {
for (auto& c : CD.getContacts()) for (auto& c : CD.getContacts())
{ {
dem(c.idx1_, c.idx2_, accessor, c.contactPoint_, c.contactNormal_, c.penetrationDepth_); sds(c.idx1_, c.idx2_, accessor, c.contactPoint_, c.contactNormal_, c.penetrationDepth_, params.dt);
} }
} }
tp["DEM"].end(); tp["SpringDashpotSpring"].end();
LIKWID_MARKER_STOP("DEM"); LIKWID_MARKER_STOP("SpringDashpotSpring");
LIKWID_MARKER_REGISTER("ReduceForce"); LIKWID_MARKER_REGISTER("ReduceForce");
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
...@@ -348,6 +381,17 @@ int main( int argc, char ** argv ) ...@@ -348,6 +381,17 @@ int main( int argc, char ** argv )
tp["ReduceForce"].end(); tp["ReduceForce"].end();
LIKWID_MARKER_STOP("ReduceForce"); LIKWID_MARKER_STOP("ReduceForce");
LIKWID_MARKER_REGISTER("ReduceContactHistory");
WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("ReduceContactHistory");
tp["ReduceContactHistory"].start();
for (int64_t i=0; i < params.simulationSteps; ++i)
{
RCH(*ps);
}
tp["ReduceContactHistory"].end();
LIKWID_MARKER_STOP("ReduceContactHistory");
LIKWID_MARKER_REGISTER("Euler"); LIKWID_MARKER_REGISTER("Euler");
WALBERLA_MPI_BARRIER(); WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("Euler"); LIKWID_MARKER_START("Euler");
...@@ -359,17 +403,6 @@ int main( int argc, char ** argv ) ...@@ -359,17 +403,6 @@ int main( int argc, char ** argv )
tp["Euler"].end(); tp["Euler"].end();
LIKWID_MARKER_STOP("Euler"); LIKWID_MARKER_STOP("Euler");
LIKWID_MARKER_REGISTER("SNN");
WALBERLA_MPI_BARRIER();
LIKWID_MARKER_START("SNN");
tp["SNN"].start();
for (int64_t i=0; i < params.simulationSteps; ++i)
{
SNN(*ps, *domain);
}
tp["SNN"].end();
LIKWID_MARKER_STOP("SNN");
WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - END ***"); WALBERLA_LOG_INFO_ON_ROOT("*** SIMULATION - END ***");
if (params.checkSimulation) if (params.checkSimulation)
......
...@@ -96,12 +96,16 @@ void ReduceContactHistory::operator()(data::ParticleStorage& ps) const ...@@ -96,12 +96,16 @@ void ReduceContactHistory::operator()(data::ParticleStorage& ps) const
const auto size = ps.size(); const auto size = ps.size();
for (size_t idx = 0; idx < size; ++idx) for (size_t idx = 0; idx < size; ++idx)
{ {
//only for kernel benchmark
// ps.getOldContactHistoryRef(idx).clear();
if (!data::particle_flags::isSet( ps.getFlags(idx), data::particle_flags::GHOST) ) if (!data::particle_flags::isSet( ps.getFlags(idx), data::particle_flags::GHOST) )
{ {
//master
std::swap(ps.getOldContactHistoryRef(idx), ps.getNewContactHistoryRef(idx)); std::swap(ps.getOldContactHistoryRef(idx), ps.getNewContactHistoryRef(idx));
ps.getNewContactHistoryRef(idx).clear(); ps.getNewContactHistoryRef(idx).clear();
} else } else
{ {
//ghost
ps.getOldContactHistoryRef(idx).clear(); ps.getOldContactHistoryRef(idx).clear();
ps.getNewContactHistoryRef(idx).clear(); ps.getNewContactHistoryRef(idx).clear();
} }
......
...@@ -96,12 +96,16 @@ void ReduceContactHistory::operator()(data::ParticleStorage& ps) const ...@@ -96,12 +96,16 @@ void ReduceContactHistory::operator()(data::ParticleStorage& ps) const
const auto size = ps.size(); const auto size = ps.size();
for (size_t idx = 0; idx < size; ++idx) for (size_t idx = 0; idx < size; ++idx)
{ {
//only for kernel benchmark
// ps.getOldContactHistoryRef(idx).clear();
if (!data::particle_flags::isSet( ps.getFlags(idx), data::particle_flags::GHOST) ) if (!data::particle_flags::isSet( ps.getFlags(idx), data::particle_flags::GHOST) )
{ {
//master
std::swap(ps.getOldContactHistoryRef(idx), ps.getNewContactHistoryRef(idx)); std::swap(ps.getOldContactHistoryRef(idx), ps.getNewContactHistoryRef(idx));
ps.getNewContactHistoryRef(idx).clear(); ps.getNewContactHistoryRef(idx).clear();
} else } else
{ {
//ghost
ps.getOldContactHistoryRef(idx).clear(); ps.getOldContactHistoryRef(idx).clear();
ps.getNewContactHistoryRef(idx).clear(); ps.getNewContactHistoryRef(idx).clear();
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment