AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
autopas::OctreeLogger< Particle_T > Class Template Reference

Log an octree to a .vtk file. More...

#include <OctreeLogger.h>

Public Member Functions

 OctreeLogger ()=default
 Constructor.
 
 ~OctreeLogger ()=default
 Destructor.
 
void logTree (OctreeNodeWrapper< Particle_T > *wrapper)
 Write the octree below the wrapper to a .vtk file.
 
void logTree (OctreeNodeInterface< Particle_T > *root)
 This function writes the octree to a .vtk file.
 

Static Public Member Functions

static FILE * leavesToJSON (FILE *out, std::vector< OctreeLeafNode< Particle_T > * > &leaves)
 Convert a list of octree leaves to JSON and write it to an output file.
 
static FILE * particlesToJSON (FILE *out, OctreeNodeInterface< Particle_T > *root)
 Print a list of particle positions to a file as JSON.
 
static void octreeToJSON (OctreeNodeInterface< Particle_T > *owned, OctreeNodeInterface< Particle_T > *halo, std::vector< OctreeLeafNode< Particle_T > * > &ownedLeaves, std::vector< OctreeLeafNode< Particle_T > * > &haloLeaves)
 Log the octree to JSON files understandable by https://github.com/AutoPas/OctreeVisualization.
 

Detailed Description

template<typename Particle_T>
class autopas::OctreeLogger< Particle_T >

Log an octree to a .vtk file.

Template Parameters
Particle_TThe enclosed particle type

Member Function Documentation

◆ leavesToJSON()

template<typename Particle_T >
static FILE * autopas::OctreeLogger< Particle_T >::leavesToJSON ( FILE *  out,
std::vector< OctreeLeafNode< Particle_T > * > &  leaves 
)
inlinestatic

Convert a list of octree leaves to JSON and write it to an output file.

The output list consists of JSON objects containing the following fields:

  • "minmax"
    A list of numbers specifying the concatenated minimum and maximum coordinate of the leaf box in 3D. This is how the coordinate list is encoded in JSON: [x1,y1,z1,x2,y2,z2].
  • "fn"
    A list of min/max coordinates of all greater than or equal face-neighbors of the leaf
  • "fnl"
    A list of min/max coordinates of all leaves that touch this leaf via a face.
  • "en"
    A list of min/max coordinates of all greater than or equal edge-neighbors of the leaf
  • "enl"
    A list of min/max coordinates of all leaves that touch this leaf via a edge.
  • "vn"
    A list of min/max coordinates of all greater than or equal vertex-neighbors of the leaf
  • "vnl"
    A list of min/max coordinates of all leaves that touch this leaf via a vertex.
Parameters
outA FILE pointer to the file that should contain the JSON data after the operation
leavesA list of octree leaves that are echoed into the JSON file
Returns
The FILE pointer is just passed through

◆ logTree() [1/2]

template<typename Particle_T >
void autopas::OctreeLogger< Particle_T >::logTree ( OctreeNodeInterface< Particle_T > *  root)
inline

This function writes the octree to a .vtk file.

Parameters
rootA pointer to the octree root node

◆ logTree() [2/2]

template<typename Particle_T >
void autopas::OctreeLogger< Particle_T >::logTree ( OctreeNodeWrapper< Particle_T > *  wrapper)
inline

Write the octree below the wrapper to a .vtk file.

Parameters
wrapperA pointer to the octree node wrapper

◆ octreeToJSON()

template<typename Particle_T >
static void autopas::OctreeLogger< Particle_T >::octreeToJSON ( OctreeNodeInterface< Particle_T > *  owned,
OctreeNodeInterface< Particle_T > *  halo,
std::vector< OctreeLeafNode< Particle_T > * > &  ownedLeaves,
std::vector< OctreeLeafNode< Particle_T > * > &  haloLeaves 
)
inlinestatic

Log the octree to JSON files understandable by https://github.com/AutoPas/OctreeVisualization.

Parameters
ownedA pointer to the root node of the owned octree
haloA pointer to the root node of the halo octree
ownedLeavesA list of leaf nodes from the owned octree
haloLeavesA list of leaf nodes from the halo octree

◆ particlesToJSON()

template<typename Particle_T >
static FILE * autopas::OctreeLogger< Particle_T >::particlesToJSON ( FILE *  out,
OctreeNodeInterface< Particle_T > *  root 
)
inlinestatic

Print a list of particle positions to a file as JSON.

The list is obtained from the octree root node.

Parameters
outThe FILE pointer to write the JSON to
rootThe root from which the particles should be obtained
Returns
The file pointer

The documentation for this class was generated from the following file: