TDMS
Time Domain Maxwell Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
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 */
16
17private:
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
31public:
32 /** @brief Construct a new fdtd Grid Initialiser object */
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};
A class to initialise an FDTD grid from a MATLAB file.
Definition fdtd_grid_initialiser.h:15
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()
Construct a new fdtd Grid Initialiser object.
Definition fdtd_grid_initialiser.h:33
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
Includes MATLAB headers for I/O.