TDMS
Time Domain Maxwell Solver
Toggle main menu visibility
Loading...
Searching...
No Matches
fdtd_grid_initialiser.h
Go to the documentation of this file.
1
/**
2
* @file fdtd_grid_initialiser.h
3
* @brief Initialisation of the FDTD grid
4
*/
5
#pragma once
6
7
#include <string>
8
#include <vector>
9
10
#include "
mat_io.h
"
11
12
/**
13
* @brief A class to initialise an FDTD grid from a MATLAB file
14
*/
15
class
fdtdGridInitialiser
{
16
17
private
:
18
const
mxArray *pointer =
nullptr
;
//< Pointer to the array
19
const
char
*mat_filename =
nullptr
;
//< Filename of the MATLAB file
20
std::vector<mwSize> dimensions = {0, 0, 0};
//< The dimensions of the array
21
22
/**
23
* @brief Get a value from a integer attribute of the FDTD grid defined in a
24
* .mat file
25
*
26
* @param key the name of the attribute
27
* @return int the value of the attribute
28
*/
29
mwSize
value_of_attribute
(
const
std::string &key);
30
31
public
:
32
/** @brief Construct a new fdtd Grid Initialiser object */
33
fdtdGridInitialiser
() {}
34
/**
35
* @brief Construct a new fdtd Grid Initialiser object
36
*
37
* @param fdtd_pointer pointer to the FDTD grid
38
* @param mat_filename the filename of the MATLAB file
39
*/
40
fdtdGridInitialiser
(
const
mxArray *fdtd_pointer,
const
char
*mat_filename);
41
42
/**
43
* @brief Set an FDTD grid attribute to a tensor full of zeros
44
* @param name of the attribute
45
*/
46
void
add_tensor
(
const
std::string &name);
47
};
fdtdGridInitialiser::add_tensor
void add_tensor(const std::string &name)
Set an FDTD grid attribute to a tensor full of zeros.
Definition
fdtd_grid_initialiser.cpp:41
fdtdGridInitialiser::fdtdGridInitialiser
fdtdGridInitialiser()
Construct a new fdtd Grid Initialiser object.
Definition
fdtd_grid_initialiser.h:33
fdtdGridInitialiser::value_of_attribute
mwSize value_of_attribute(const std::string &key)
Get a value from a integer attribute of the FDTD grid defined in a .mat file.
Definition
fdtd_grid_initialiser.cpp:22
mat_io.h
Includes MATLAB headers for I/O.
tdms
include
fdtd_grid_initialiser.h
Generated by
1.17.0