Commit 5e0f42c8 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added shift to make collision points unique

parent 4a79adc5
......@@ -125,7 +125,7 @@ int main( int argc, char ** argv )
for (auto& iBlk : *forest)
{
for (auto pt : grid_generator::SCGrid(iBlk.getAABB(),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing))
{
WALBERLA_CHECK(iBlk.getAABB().contains(pt));
......
......@@ -128,7 +128,7 @@ int main( int argc, char ** argv )
for (auto& iBlk : *forest)
{
for (auto pt : grid_generator::SCGrid(iBlk.getAABB(),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing))
{
WALBERLA_CHECK(iBlk.getAABB().contains(pt));
......
......@@ -207,7 +207,7 @@ int main( int argc, char ** argv )
for (auto& iBlk : *forest)
{
for (auto pt : grid_generator::SCGrid(iBlk.getAABB(),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing))
{
WALBERLA_CHECK(iBlk.getAABB().contains(pt));
......
......@@ -203,7 +203,7 @@ int main( int argc, char ** argv )
for (auto& iBlk : *forest)
{
for (auto pt : grid_generator::SCGrid(iBlk.getAABB(),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing))
{
WALBERLA_CHECK(iBlk.getAABB().contains(pt));
......
......@@ -190,7 +190,7 @@ int main( int argc, char ** argv )
for (auto& currentBlock : *forest)
{
for (auto it = grid_generator::SCIterator(currentBlock.getAABB().getIntersection(generationDomain),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing);
it != grid_generator::SCIterator();
++it)
......
......@@ -268,7 +268,7 @@ int main( int argc, char ** argv )
for (auto& currentBlock : *forest)
{
for (auto it = grid_generator::SCIterator(currentBlock.getAABB().getIntersection(generationDomain),
Vector3<real_t>(params.spacing) * real_c(0.5),
Vector3<real_t>(params.spacing) * real_c(0.5) + params.shift,
params.spacing);
it != grid_generator::SCIterator();
++it)
......
......@@ -42,6 +42,9 @@ void loadFromConfig(Parameters& params, const Config::BlockHandle& cfg)
params.spacing = cfg.getParameter<real_t>("spacing", real_t(1.0) );
WALBERLA_LOG_INFO_ON_ROOT("spacing: " << params.spacing);
params.shift = cfg.getParameter<Vec3>("shift", Vec3(real_t(0.1), real_t(0.1), real_t(0.1)) );
WALBERLA_LOG_INFO_ON_ROOT("shift: " << params.shift);
params.radius = cfg.getParameter<real_t>("radius", real_t(0.5) );
WALBERLA_LOG_INFO_ON_ROOT("radius: " << params.radius);
......@@ -135,6 +138,7 @@ void saveToSQL(const Parameters& params,
realProperties["spacing"] = double_c(params.spacing);
realProperties["radius"] = double_c(params.radius);
......
......@@ -39,6 +39,7 @@ struct Parameters
std::string sorting = "none";
Vec3 normal = Vec3(real_t(1.0), real_t(1.0), real_t(1.0));
real_t spacing = real_t(1.0);
Vec3 shift = Vec3(real_t(0.1), real_t(0.1), real_t(0.1));
real_t radius = real_t(0.5);
bool bBarrier = false;
bool storeNodeTimings = false;
......
......@@ -7,6 +7,7 @@ cfg = Config()
cfg.addParameter("sorting", "std::string", '"none"')
cfg.addParameter("normal", "Vec3", "Vec3(real_t(1.0), real_t(1.0), real_t(1.0))")
cfg.addParameter("spacing", "real_t", "real_t(1.0)")
cfg.addParameter("shift", "Vec3", "Vec3(real_t(0.1), real_t(0.1), real_t(0.1))")
cfg.addParameter("radius", "real_t", "real_t(0.5)")
cfg.addParameter("bBarrier", "bool", "false")
cfg.addParameter("storeNodeTimings", "bool", "false")
......
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