Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
d9a85999
Commit
d9a85999
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Expand documentation for TransitionMatrix class
parent
c0c4c3ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/include/TransitionMatrix.h
+31
-4
31 additions, 4 deletions
src/include/TransitionMatrix.h
with
31 additions
and
4 deletions
src/include/TransitionMatrix.h
+
31
−
4
View file @
d9a85999
...
@@ -48,6 +48,9 @@ class TransitionMatrix {
...
@@ -48,6 +48,9 @@ class TransitionMatrix {
int
*
shape
;
int
*
shape
;
/*! \brief Build transition matrix from a HDF5 binary input file.
/*! \brief Build transition matrix from a HDF5 binary input file.
*
* This function takes care of the specific task of building a transition
* matrix memory data structure from a HDF5 binary input file.
*
*
* \param file_name: `string` Name of the binary configuration data file.
* \param file_name: `string` Name of the binary configuration data file.
* \return config: `TransitionMatrix *` Pointer to object containing the
* \return config: `TransitionMatrix *` Pointer to object containing the
...
@@ -64,6 +67,10 @@ class TransitionMatrix {
...
@@ -64,6 +67,10 @@ class TransitionMatrix {
static
TransitionMatrix
*
from_legacy
(
std
::
string
file_name
);
static
TransitionMatrix
*
from_legacy
(
std
::
string
file_name
);
/*! \brief Write the Transition Matrix to HDF5 binary output.
/*! \brief Write the Transition Matrix to HDF5 binary output.
*
* This function takes care of the specific task of building a transition
* matrix memory data structure from a binary input file formatted according
* to the structure used by the original FORTRAN code.
*
*
* \param file_name: `string` Name of the binary configuration data file.
* \param file_name: `string` Name of the binary configuration data file.
*/
*/
...
@@ -79,8 +86,8 @@ class TransitionMatrix {
...
@@ -79,8 +86,8 @@ class TransitionMatrix {
*
*
* \param _is: `int` Matrix type identifier
* \param _is: `int` Matrix type identifier
* \param _lm: `int` Maximum field expansion order.
* \param _lm: `int` Maximum field expansion order.
* \param _vk: `double`
* \param _vk: `double`
Wave number in scale units.
* \param _exri: `double`
* \param _exri: `double`
External medium refractive index.
* \param _elements: `complex<double> *` Vectorized elements of the matrix.
* \param _elements: `complex<double> *` Vectorized elements of the matrix.
* \param _radius: `double` Radius for the single sphere case (defaults to 0.0).
* \param _radius: `double` Radius for the single sphere case (defaults to 0.0).
*/
*/
...
@@ -90,6 +97,9 @@ class TransitionMatrix {
...
@@ -90,6 +97,9 @@ class TransitionMatrix {
);
);
/*! \brief Transition Matrix instance constructor for single sphere.
/*! \brief Transition Matrix instance constructor for single sphere.
*
* This constructor allocates the memory structure needed to represent the transition
* matrix for the case of a single sphere.
*
*
* \param _lm: `int` Maximum field expansion order.
* \param _lm: `int` Maximum field expansion order.
* \param _vk: `double` Wave number in scale units.
* \param _vk: `double` Wave number in scale units.
...
@@ -104,11 +114,14 @@ class TransitionMatrix {
...
@@ -104,11 +114,14 @@ class TransitionMatrix {
);
);
/*! \brief Transition Matrix instance constructor for a cluster of spheres.
/*! \brief Transition Matrix instance constructor for a cluster of spheres.
*
* This constructor allocates the memory structure needed to represent the transition
* matrix for the case of a cluster of spheres.
*
*
* \param _nlemt: `int` Size of the matrix (2 * LE * (LE + 2)).
* \param _nlemt: `int` Size of the matrix (2 * LE * (LE + 2)).
* \param _lm: `int` Maximum field expansion order.
* \param _lm: `int` Maximum field expansion order.
* \param _vk: `double`
* \param _vk: `double`
Wave number in scale units.
* \param _exri: `double`
* \param _exri: `double`
External medium refractive index.
* \param _am0m: Matrix of complex.
* \param _am0m: Matrix of complex.
*/
*/
TransitionMatrix
(
int
_nlemt
,
int
_lm
,
double
_vk
,
double
_exri
,
std
::
complex
<
double
>
**
_am0m
);
TransitionMatrix
(
int
_nlemt
,
int
_lm
,
double
_vk
,
double
_exri
,
std
::
complex
<
double
>
**
_am0m
);
...
@@ -118,6 +131,14 @@ class TransitionMatrix {
...
@@ -118,6 +131,14 @@ class TransitionMatrix {
~
TransitionMatrix
();
~
TransitionMatrix
();
/*! \brief Build transition matrix from binary input file.
/*! \brief Build transition matrix from binary input file.
*
* In some cases, it is necessary to perform calculations starting from a pre-computed
* transition matrix. If this matrix is not available in memory (e.g. because it was
* calculated by a different process), but it was saved in a binary file, this function
* can be used to load it back in memory. The function operates in two modes: "LEGACY",
* which reads the matrix data from a proprietary binary file, having the same structure
* as the one used by the original FORTRAN code, and "HDF5", which, instead, reads the
* data from an input file complying with the HDF5 format.
*
*
* \param file_name: `string` Name of the binary configuration data file.
* \param file_name: `string` Name of the binary configuration data file.
* \param mode: `string` Binary encoding. Can be one of ["LEGACY", "HDF5"]. Optional
* \param mode: `string` Binary encoding. Can be one of ["LEGACY", "HDF5"]. Optional
...
@@ -128,6 +149,12 @@ class TransitionMatrix {
...
@@ -128,6 +149,12 @@ class TransitionMatrix {
static
TransitionMatrix
*
from_binary
(
std
::
string
file_name
,
std
::
string
mode
=
"LEGACY"
);
static
TransitionMatrix
*
from_binary
(
std
::
string
file_name
,
std
::
string
mode
=
"LEGACY"
);
/*! \brief Write the Transition Matrix to a binary file.
/*! \brief Write the Transition Matrix to a binary file.
*
* This function writes a hard-copy of the transition matrix to an output file, making
* it available for subsequent processes to reload. The function operates in two modes:
* "LEGACY", which writes a proprietary binary file, using the same structure of the
* original FORTRAN code, and "HDF5", which, instead, writes the output to a file using
* the HDF5 format, thus leaving it available for inspection with external tools.
*
*
* \param file_name: `string` Name of the file to be written.
* \param file_name: `string` Name of the file to be written.
* \param mode: `string` Binary encoding. Can be one of ["LEGACY", "HDF5"] . Optional
* \param mode: `string` Binary encoding. Can be one of ["LEGACY", "HDF5"] . Optional
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment