TDMS
Time Domain Maxwell Solver
Toggle main menu visibility
Loading...
Searching...
No Matches
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
"
9
#include "
simulation_parameters.h
"
10
11
class
FieldSample {
12
13
private
:
14
double
****tensor =
nullptr
;
15
16
public
:
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
*/
39
bool
all_vectors_are_non_empty
()
const
{
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
*/
54
void
extract
(ElectricSplitField &E_split, PerfectlyMatchedLayer &pml,
55
int
n_simulation_timesteps);
56
57
~FieldSample();
58
};
arrays.h
Classes describing arrays, vertices etc.
FieldSample::i
Vector< int > i
Definition
fieldsample.h:19
FieldSample::k
Vector< int > k
Definition
fieldsample.h:23
FieldSample::all_vectors_are_non_empty
bool all_vectors_are_non_empty() const
Definition
fieldsample.h:39
FieldSample::j
Vector< int > j
Definition
fieldsample.h:21
FieldSample::n
Vector< double > n
Vector of the moments of the field to sample.
Definition
fieldsample.h:25
FieldSample::set_from
void set_from(const mxArray *ptr)
Setup using data from an input file.
Definition
fieldsample.cpp:3
FieldSample::extract
void extract(ElectricSplitField &E_split, PerfectlyMatchedLayer &pml, int n_simulation_timesteps)
Extract the (Electric) field values at the vertices.
Definition
fieldsample.cpp:27
FieldSample::mx
mxArray * mx
Matlab array.
Definition
fieldsample.h:17
Vector
Definition
arrays.h:74
field.h
Classes for the electric and magnetic (split) fields on a grid.
simulation_parameters.h
Classes collecting parameters for the simulation.
tdms
include
fieldsample.h
Generated by
1.17.0