summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/poiseulle_particles_2d_gpu/sim.cpp6
-rw-r--r--lib/core/c++/boundary.hpp2
-rw-r--r--lib/core/c++/write_vtk.hpp12
3 files changed, 11 insertions, 9 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp
index bdd93b0..305ef80 100644
--- a/examples/poiseulle_particles_2d_gpu/sim.cpp
+++ b/examples/poiseulle_particles_2d_gpu/sim.cpp
@@ -7,8 +7,8 @@
namespace kel {
namespace lbm {
-constexpr uint64_t dim_x = 1024u;
-constexpr uint64_t dim_y = 512u;
+constexpr uint64_t dim_x = 2048u;
+constexpr uint64_t dim_y = 1024u;
namespace sch {
using namespace saw::schema;
@@ -119,7 +119,7 @@ saw::error_or<void> step(
// Need nicer things to handle the flow. I see improvement here
component<T,Desc,cmpt::BGK,encode::Sycl<saw::encode::Native>> collision{0.6};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
- component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{1.001};
+ component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{1.01};
component<T,Desc,cmpt::ZouHeHorizontal<false>,encode::Sycl<saw::encode::Native>> flow_out{1.0};
h.parallel_for(acpp::sycl::range<Desc::D>{dim_x,dim_y}, [=](acpp::sycl::id<Desc::D> idx){
diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp
index ec16edf..6d83c79 100644
--- a/lib/core/c++/boundary.hpp
+++ b/lib/core/c++/boundary.hpp
@@ -117,7 +117,7 @@ public:
for(saw::data<sch::UInt64> k{0u}; k < saw::data<sch::UInt64>{Descriptor::Q}; ++k){
auto c_k = dfi::directions[k.get()];
- if(c_k[0u]*known_dir > 0){
+ if(c_k[0u]*known_dir < 0){
sum_unknown_dfs += dfs_old.at({k}) * c_k[0u];
}
}
diff --git a/lib/core/c++/write_vtk.hpp b/lib/core/c++/write_vtk.hpp
index 3c60a66..751ec50 100644
--- a/lib/core/c++/write_vtk.hpp
+++ b/lib/core/c++/write_vtk.hpp
@@ -67,12 +67,14 @@ struct lbm_vtk_writer<sch::FixedArray<T,D>> {
template<typename T, uint64_t Ghost, uint64_t... D>
struct lbm_vtk_writer<sch::Chunk<T,Ghost,D...>> {
+
template<uint64_t d>
static saw::error_or<void> apply_d(std::ostream& vtk_file, const saw::data<sch::Chunk<T,Ghost,D...>>& field, saw::data<sch::FixedArray<sch::UInt64,sizeof...(D)>>& index){
-
- if constexpr ( d < sizeof...(D)){
- for(index.at({d}) = 0u; index.at({d}) < field.get_dims().at({d}); ++index.at({d})){
- auto eov = apply_d<d+1u>(vtk_file, field, index);
+ // VTK wants to iterate over z,y,x instead of x,y,z
+ // We could reorder the dimensions, but eh
+ if constexpr ( d > 0u){
+ for(index.at({d-1u}) = 0u; index.at({d-1u}) < field.get_dims().at({d-1u}); ++index.at({d-1u})){
+ auto eov = apply_d<d-1u>(vtk_file, field, index);
}
}else{
auto eov = lbm_vtk_writer<T>::apply(vtk_file, field.at(index));
@@ -94,7 +96,7 @@ struct lbm_vtk_writer<sch::Chunk<T,Ghost,D...>> {
}
{
- auto eov = apply_d<0u>(vtk_file, field, index);
+ auto eov = apply_d<sizeof...(D)>(vtk_file, field, index);
if(eov.is_error()){
return eov;
}