diff --git a/apps/tutorials/lbm/04_LBComplexGeometry.cpp b/apps/tutorials/lbm/04_LBComplexGeometry.cpp index 9b02de05a655bd46b3f45ac0d3f3811501128b6e..dedc750f84b9354e9255365ba2da229aa1c3cdcb 100644 --- a/apps/tutorials/lbm/04_LBComplexGeometry.cpp +++ b/apps/tutorials/lbm/04_LBComplexGeometry.cpp @@ -162,8 +162,13 @@ int main(int argc, char** argv) WALBERLA_LOG_INFO_ON_ROOT("Octree has height " << distanceOctree->height()) + //! [octreeVTK] // write distance octree to file - distanceOctree->writeVTKOutput("distanceOctree"); + WALBERLA_ROOT_SECTION() + { + distanceOctree->writeVTKOutput("distanceOctree"); + } + //! [octreeVTK] /////////////////////////// /// CREATE BLOCK FOREST /// @@ -325,4 +330,4 @@ int main(int argc, char** argv) } } // namespace walberla -int main(int argc, char** argv) { walberla::main(argc, argv); } \ No newline at end of file +int main(int argc, char** argv) { walberla::main(argc, argv); } diff --git a/apps/tutorials/lbm/04_LBComplexGeometry.dox b/apps/tutorials/lbm/04_LBComplexGeometry.dox index dd1d7e74ea03aa1fb39565c727493508bf346d49..5c8b1fa6a00a17ee69ce62b3ac7c77f1d69f4bd1 100644 --- a/apps/tutorials/lbm/04_LBComplexGeometry.dox +++ b/apps/tutorials/lbm/04_LBComplexGeometry.dox @@ -59,6 +59,9 @@ After calling this function, we prepare for building the distance octree by prec From this information we can finally build the distance octree. It stores information about how close or far boundaries are to each other. Later, this information could be used for e.g. adaptive mesh refinement (note that this will not be covered in this tutorial). \snippet 04_LBComplexGeometry.cpp octree +When writing the distance octree to disk (e.g. for debugging purposes), care must be taken to execute the write function only on the root node: +\snippet 04_LBComplexGeometry.cpp octreeVTK + Even though we have successfully loaded the complex geometry and set up the corresponding distance octree, we have not defined our computational LB domain yet. In this tutorial, the LB domain is defined relatively to the loaded geometry. Henceforth, we calculate the axis-aligned bounding box of the geometry and scale it to our needs. Here, we chose our channel to be 10x3x1 times the size of the Stanford Bunny. This scaling is defined in the parameter file (parameter: domainScaling). diff --git a/src/mesh_common/distance_octree/DistanceOctree.h b/src/mesh_common/distance_octree/DistanceOctree.h index ce1a21c16cd56f8ba9d78d59e3ae4570aa352968..7e58f969ea3e09b3ec385481bd8dc36edd6efeb9 100644 --- a/src/mesh_common/distance_octree/DistanceOctree.h +++ b/src/mesh_common/distance_octree/DistanceOctree.h @@ -133,6 +133,20 @@ protected: +//********************************************************************************************************************** +/*! \brief Write the distance octree to a VTK file. + * + * This method should only be called by the root process: + * \code + WALBERLA_ROOT_SECTION() + { + distanceOctree->writeVTKOutput("distanceOctree"); + } + * \endcode + * + * \param filestem name of the VTK file without extension + */ +//********************************************************************************************************************** template <typename MeshType> void DistanceOctree<MeshType>::writeVTKOutput( const std::string & filestem ) const {