TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
fieldsample.h
Go to the documentation of this file.
1/**
2 * @file fieldsample.h
3 * @brief Class that stores the extracted field values at user-defined vertices.
4 */
5#pragma once
6
7#include "arrays.h"
8#include "field.h"
10
12
13private:
14 double ****tensor = nullptr;
15
16public:
17 mxArray *mx;//!< Matlab array
18
19 Vector<int> i; //!< Indices along the x-direction of locations at which to
20 //!< sample the field
21 Vector<int> j; //!< Indices along the y-direction of locations at which to
22 //!< sample the field
23 Vector<int> k; //!< Indices along the z-direction of locations at which to
24 //!< sample the field
25 Vector<double> n;//!< Vector of the moments of the field to sample
26
27 FieldSample() = default;
28 explicit FieldSample(const mxArray *ptr) { set_from(ptr); }
29 /**
30 * @brief Setup using data from an input file
31 *
32 * @param ptr Pointer to the struct containing the list of vertices and
33 * components to extract phasors at/for
34 */
35 void set_from(const mxArray *ptr);
36
37 /** Return true if all vectors in this instance are non-empty (have size > 0)
38 */
40 return i.size() > 0 && j.size() > 0 && k.size() > 0 && n.size() > 0;
41 };
42
43 inline double ***operator[](int value) const { return tensor[value]; };
44
45 /**
46 * @brief Extract the (Electric) field values at the vertices
47 *
48 * @param E_split Values of the electric (split) field
49 * @param pml A description of the perfectly matched layer being used in this
50 * simulation
51 * @param n_simulation_timesteps The (total) number of timesteps in this
52 * simulation
53 */
55 int n_simulation_timesteps);
56
58};
Classes describing arrays, vertices etc.
Definition field.h:161
Definition fieldsample.h:11
Vector< int > i
Definition fieldsample.h:19
Vector< int > k
Definition fieldsample.h:23
bool all_vectors_are_non_empty() const
Definition fieldsample.h:39
Vector< int > j
Definition fieldsample.h:21
Vector< double > n
Vector of the moments of the field to sample.
Definition fieldsample.h:25
void set_from(const mxArray *ptr)
Setup using data from an input file.
Definition fieldsample.cpp:3
void extract(ElectricSplitField &E_split, PerfectlyMatchedLayer &pml, int n_simulation_timesteps)
Extract the (Electric) field values at the vertices.
Definition fieldsample.cpp:27
mxArray * mx
Matlab array.
Definition fieldsample.h:17
Definition arrays.h:74
Classes for the electric and magnetic (split) fields on a grid.
Classes collecting parameters for the simulation.
Definition simulation_parameters.h:15