Skip to content
Snippets Groups Projects
Commit ec0780b7 authored by Daniel Bauer's avatar Daniel Bauer :speech_balloon:
Browse files

add note about writing distance octree on root node only

parent 6b0e8cab
Branches
Tags
No related merge requests found
......@@ -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); }
......@@ -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).
......
......@@ -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
{
......
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