Extension: Json and NetCDF utilities
#include "dg/file/file.h"
Loading...
Searching...
No Matches
probes_params.h
Go to the documentation of this file.
1#pragma once
2#include "../dg/backend/typedefs.h"
3
4namespace dg
5{
6namespace file
7{
8
15{
31 std::vector< dg::HVec> coords;
32 std::vector<std::string> coords_names;
38 std::string format;
49 bool probes = false;
50
57 unsigned get_coords_sizes( ) const
58 {
59 unsigned m_num_pins = coords[0].size();
60 for( unsigned i=1; i<coords.size(); i++)
61 {
62 unsigned num_pins = coords[i].size();
63 if( m_num_pins != num_pins)
64 throw std::runtime_error( "Size of "+coords_names[i] +" probes array ("
65 +std::to_string(num_pins)+") does not match that of "+coords_names[0]+" ("
66 +std::to_string(m_num_pins)+")!");
67 }
68 return m_num_pins;
69 }
70};
71}//namespace file
72}//namespace dg
Definition easy_atts.h:15
Parameter struct for probe values.
Definition probes_params.h:15
std::vector< dg::HVec > coords
Coordinates list.
Definition probes_params.h:31
unsigned get_coords_sizes() const
Check that coords all have same size and return that size.
Definition probes_params.h:57
bool probes
Indicate existence of probes.
Definition probes_params.h:49
std::vector< std::string > coords_names
Name of coordinates (must have same size as coords)
Definition probes_params.h:32
std::string format
Optional format string for coords.
Definition probes_params.h:38