Commit 57fc7153 authored by Christian Koch's avatar Christian Koch
Browse files

Quaternion fun

parent 0f3d383a
Pipeline #26603 failed with stages
in 38 minutes and 25 seconds
......@@ -61,7 +61,7 @@ namespace mesa_pd {
walberla::mpi::MPIManager::instance()->useWorldComm();
math::seedRandomGenerator( numeric_cast<std::mt19937::result_type>( 6174 * walberla::mpi::MPIManager::instance()->rank() ) );
auto forest = blockforest::createBlockForest( AABB(0,0,0,100,100,100), // simulation domain
auto forest = blockforest::createBlockForest( AABB(0,0,0,20,20,20), // simulation domain
Vector3<uint_t>(1,1,1), // blocks in each direction
Vector3<bool>(false, false, false) // periodicity
);
......@@ -78,14 +78,14 @@ namespace mesa_pd {
real_t lcSize = real_t(1.3);
data::LinkedCells lc(blk.getAABB(), lcSize);
std::cout << "LinkedCells Size: " << lcSize << std::endl;
size_t osMaxDepth = 6;
size_t osMaxDepth = 4;
size_t osMaxSize = 11;
data::OctreeStorage os(blk.getAABB(), osMaxDepth, osMaxSize);
std::cout << "OS - maxDepth: " << osMaxDepth << ", maxSize: " << osMaxSize << std::endl;
data::HashGrid hg(2, 7, blk.getAABB());
//simulation particle values
size_t num_particles = 100000;
size_t num_particles = 1000;
std::vector<Vec3> startPosition;
std::vector<Vec3> startVelocity;
std::vector<Vec3> endPosition;
......@@ -118,7 +118,7 @@ namespace mesa_pd {
}
}
WALBERLA_LOG_INFO("Built Particles");
WALBERLA_LOG_INFO("Defined Particles");
//initialize particles and walls
......@@ -141,8 +141,6 @@ namespace mesa_pd {
auto simulationDomain = forest->getDomain();
createWall(*ps, *ss, simulationDomain.minCorner(), Vec3(+1,0,0) );
createWall(*ps, *ss, simulationDomain.maxCorner(), Vec3(-1,0,0) );
createWall(*ps, *ss, simulationDomain.minCorner(), Vec3(0,+1,0) );
......@@ -158,6 +156,8 @@ namespace mesa_pd {
sp->setOwner ( walberla::MPIManager::instance()->rank() );
sp->setType ( 0 );
sp->setLinearVelocity(Vec3(startVelocity[i]));
math::Rot3<real_t> tmp;
sp->setRotation(tmp);
}
//init kernels
......@@ -170,8 +170,8 @@ namespace mesa_pd {
lc.clear();
size_t calls = 0;
size_t steps = 200;
size_t callData[4][200]; // size=steps
size_t steps = 10;
size_t callData[4][10]; // size=steps
std::cout << "Steps: " << steps << std::endl;
/*timing::Timer<timing::WcPolicy> timer;
timing::Timer<timing::WcPolicy> timerColl;
......@@ -185,25 +185,6 @@ namespace mesa_pd {
// LINKED CELLS
ps->clear();
createWall(*ps, *ss, simulationDomain.minCorner(), Vec3(+1,0,0) );
createWall(*ps, *ss, simulationDomain.maxCorner(), Vec3(-1,0,0) );
createWall(*ps, *ss, simulationDomain.minCorner(), Vec3(0,+1,0) );
createWall(*ps, *ss, simulationDomain.maxCorner(), Vec3(0,-1,0) );
createWall(*ps, *ss, simulationDomain.minCorner(), Vec3(0,0,+1) );
createWall(*ps, *ss, simulationDomain.maxCorner(), Vec3(0,0,-1) );
for(size_t i = 0; i < num_particles; i++) {
auto sp = ps->create();
sp->setPosition ( Vec3(startPosition[i]));
sp->setInteractionRadius ( radius );
sp->setShapeID ( smallSphere );
sp->setOwner ( walberla::MPIManager::instance()->rank() );
sp->setType ( 0 );
sp->setLinearVelocity(Vec3(startVelocity[i]));
}
//timer.start();
for(size_t i = 0; i < steps; i++) {
......
Markdown is supported
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