HyperHDG
Classes | Namespaces | Functions
plot.hxx File Reference
#include <HyperHDG/compile_time_tricks.hxx>
#include <HyperHDG/dense_la.hxx>
#include <HyperHDG/hdg_hypergraph.hxx>
#include <HyperHDG/hypercube.hxx>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <tuple>
Include dependency graph for plot.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PlotOptions
 A class storing options for plotting. More...
 

Namespaces

 PlotFunctions
 Auxiliary functions for writing graphics files.
 

Functions

std::string set_plot_option (PlotOptions &plot_options, const std::string &option, std::string value="")
 Set a plot option and return the new value of this option as std::string. More...
 
template<typename HyperGraphT , typename LocalSolverT , typename LargeVecT , typename floatT = float>
void plot (HyperGraphT &hyper_graph, const LocalSolverT &local_solver, const LargeVecT &lambda, PlotOptions &plot_options, const floatT time=0.)
 Function plotting the solution of an equation on a hypergraph in vtu format. More...
 
 PlotFunctions::HAS_MEMBER_FUNCTION (bulk_values, has_bulk_values)
 Prepare struct to check for function to exist (cf. compile_time_tricks.hxx). More...
 
std::string PlotFunctions::fileType_to_string (const PlotOptions::fileType &type)
 Turn fileType enum into string. More...
 
std::ofstream PlotFunctions::open_ofstream (const PlotOptions &plot_options, const bool append=false)
 Open stream to file. More...
 
void PlotFunctions::close_ofstream (std::ofstream &myfile)
 Close stream to file. More...
 
template<unsigned int dim, typename pt_index_t >
void PlotFunctions::vtu_sub_cube_connectivity (std::ostream &output, unsigned int n, pt_index_t offset)
 Output of the cubes of the subdivision of an edge in lexicographic order. More...
 
template<class HyperGraphT , unsigned int n_subpoints, typename hyEdge_index_t = unsigned int, typename pt_index_t = unsigned int>
void PlotFunctions::plot_vtu_unstructured_geometry (std::ostream &output, HyperGraphT &hyper_graph, const SmallVec< n_subpoints, float > &sub_points, const SmallVec< n_subpoints, float > &boundary_sub_points, const PlotOptions &plot_options)
 Auxiliary function for writing geometry section VTU files. More...
 
template<unsigned int edge_dim, class HyperGraphT , typename hyEdge_index_t , typename LargeVecT >
std::array< std::array< typename LargeVecT::value_type, HyperGraphT::n_dofs_per_node()>, 2 *edge_dim > get_edge_dof_values (HyperGraphT &hyper_graph, hyEdge_index_t edge_index, const LargeVecT &lambda)
 Auxiliary function to get dof values of edge. More...
 
template<class HyperGraphT , class LocalSolverT , typename LargeVecT , typename floatT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_edge_values (HyperGraphT &hyper_graph, const LocalSolverT &local_solver, const LargeVecT &lambda, std::ofstream &myfile, SmallVec< n_subdivisions+1, float > abscissas, const floatT time)
 Auxiliary function to plot solution values on edge. More...
 
template<unsigned int index, typename functions >
static constexpr unsigned int first_dof ()
 Auxiliary function to plot solution values on edge boundary. More...
 
template<unsigned int component, typename LocalSolverT , typename dof_value_t , typename lv_t , typename hd_t , typename pt_t >
void fancy_recursion (__attribute__((unused)) lv_t &local_values, __attribute__((unused)) const hd_t &hyEdge_dofs, __attribute__((unused)) const pt_t &point, __attribute__((unused)) const unsigned int k, __attribute__((unused)) const unsigned int bdr_index)
 Auxiliary function to plot solution values on edge boundary. More...
 
template<class HyperGraphT , class LocalSolverT , typename LargeVecT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_boundary_values (HyperGraphT &hyper_graph, const LargeVecT &lambda, std::ofstream &myfile, SmallVec< n_subdivisions+1, float > abscissas)
 Auxiliary function to plot solution values on edge boundary. More...
 
template<class HyperGraphT , class LocalSolverT , typename LargeVecT , typename floatT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_vtu (HyperGraphT &hyper_graph, const LocalSolverT &local_solver, const LargeVecT &lambda, const PlotOptions &plot_options, const floatT time=0.)
 Auxiliary function to plot solution values to vtu file. More...
 

Function Documentation

◆ fancy_recursion()

template<unsigned int component, typename LocalSolverT , typename dof_value_t , typename lv_t , typename hd_t , typename pt_t >
void fancy_recursion ( __attribute__((unused)) lv_t &  local_values,
__attribute__((unused)) const hd_t &  hyEdge_dofs,
__attribute__((unused)) const pt_t &  point,
__attribute__((unused)) const unsigned int  k,
__attribute__((unused)) const unsigned int  bdr_index 
)

Auxiliary function to plot solution values on edge boundary.


Here is the call graph for this function:

◆ first_dof()

template<unsigned int index, typename functions >
static constexpr unsigned int first_dof ( )
staticconstexpr

Auxiliary function to plot solution values on edge boundary.


◆ get_edge_dof_values()

template<unsigned int edge_dim, class HyperGraphT , typename hyEdge_index_t , typename LargeVecT >
std::array<std::array<typename LargeVecT::value_type, HyperGraphT::n_dofs_per_node()>, 2 * edge_dim> get_edge_dof_values ( HyperGraphT &  hyper_graph,
hyEdge_index_t  edge_index,
const LargeVecT &  lambda 
)

Auxiliary function to get dof values of edge.


Here is the call graph for this function:

◆ plot()

template<typename HyperGraphT , typename LocalSolverT , typename LargeVecT , typename floatT = float>
void plot ( HyperGraphT &  hyper_graph,
const LocalSolverT &  local_solver,
const LargeVecT &  lambda,
PlotOptions plot_options,
const floatT  time = 0. 
)

Function plotting the solution of an equation on a hypergraph in vtu format.


Creates a file according to set plotting options in plot_options. This file contains the solution of the PDE defined in plotOpt having the representation lambda in terms of its skeleta degrees of freedom (related to skeletal variable lambda).

Template Parameters
HyperGraphTTemplate parameter describing the precise class of the HDGHyperGraph, i.e., it contains an HDGHyperGraph with chosen template parameters describing its topology, geometry, etc.
LocalSolverTTemplate parameter describing the precise class of the local solver, i.e., it contains an local solver for a specific equation living on the hypergraph.
LargeVecTThe typename of the large vector.
floatTThe floating point type in wihch time is given of dof values.
Parameters
hyper_graphThe hypergraph.
local_solverThe local solver.
lambdaLarge vector containing the skeletal degrees of freedom encoding the representation of the unique solution.
plot_optionsPlotOptions object containing plotting options.
timeThe time stamp.
Authors
Guido Kanschat, Heidelberg University, 2020.
Andreas Rupp, Heidelberg University, 2020.
Here is the call graph for this function:

◆ plot_boundary_values()

template<class HyperGraphT , class LocalSolverT , typename LargeVecT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_boundary_values ( HyperGraphT &  hyper_graph,
const LargeVecT &  lambda,
std::ofstream &  myfile,
SmallVec< n_subdivisions+1, float >  abscissas 
)

Auxiliary function to plot solution values on edge boundary.


Here is the call graph for this function:

◆ plot_edge_values()

template<class HyperGraphT , class LocalSolverT , typename LargeVecT , typename floatT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_edge_values ( HyperGraphT &  hyper_graph,
const LocalSolverT &  local_solver,
const LargeVecT &  lambda,
std::ofstream &  myfile,
SmallVec< n_subdivisions+1, float >  abscissas,
const floatT  time 
)

Auxiliary function to plot solution values on edge.


Here is the call graph for this function:

◆ plot_vtu()

template<class HyperGraphT , class LocalSolverT , typename LargeVecT , typename floatT , unsigned int n_subdivisions = 1, typename hyEdge_index_t = unsigned int>
void plot_vtu ( HyperGraphT &  hyper_graph,
const LocalSolverT &  local_solver,
const LargeVecT &  lambda,
const PlotOptions plot_options,
const floatT  time = 0. 
)

Auxiliary function to plot solution values to vtu file.


Here is the call graph for this function:

◆ set_plot_option()

std::string set_plot_option ( PlotOptions plot_options,
const std::string &  option,
std::string  value = "" 
)

Set a plot option and return the new value of this option as std::string.