Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
742a5caf
Commit
742a5caf
authored
Dec 10, 2020
by
Steffen Schotthöfer
Browse files
added headers for monomial basis and abstract base class
parent
444eeaa2
Pipeline
#122485
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
code/include/toolboxes/sphericalbasisbase.h
0 → 100644
View file @
742a5caf
/*!
* @file sphericalbasisbase.h
* @brief Base Class to handle basis classes on the unit sphere
* @author S. Schotthöfer
*
*/
#ifndef SPHERICALBASISBASE_H
#define SPHERICALBASISBASE_H
#include "common/typedef.h"
class
Config
;
class
SphericalBasisBase
{
public:
SphericalBasisBase
()
{}
~
SphericalBasisBase
()
{}
/*! @brief: Create a set of basis functions on the unit sphere defined in settings
* @param: Pointer to the config file
* @returns: Pointer to the createt basis class */
static
SphericalBasisBase
*
Create
(
Config
*
settings
);
/*! @brief : Computes all N basis functions at point (my, phi)
* @param : my = cos(theta) - spherical coordinate, -1 <= x <= 1
* @param : phi - spherical coordinate, 0 <= phi <= 2*pi
* @return : vector of basis functions at point (my, phi) with size N
*/
virtual
Vector
ComputeSphericalBasis
(
double
my
,
double
phi
)
=
0
;
/*! @brief : Computes all basis functions at point (x, y, z) on the unit sphere
* @param : x,y,z = coordinates on unit sphere
* @return : vector of basis functions at point (x,y,z) with size N
*/
virtual
Vector
ComputeSphericalBasis
(
double
x
,
double
y
,
double
z
)
=
0
;
};
#endif // SPHERICALBASISBASE_H
code/include/toolboxes/sphericalmonomials.h
0 → 100644
View file @
742a5caf
/*!
* @file sphericalmonomials.h
* @brief Class for efficient computation of a spherical monomial basis
* @author S. Schotthöfer
*/
#ifndef SPHERICALMONOMIALS_H
#define SPHERICALMONOMIALS_H
#include "common/typedef.h"
#include "toolboxes/sphericalbasisbase.h"
#include <vector>
class
SphericalMonomials
:
public
SphericalBasisBase
{
public:
/*! @brief : Sets up class for monomial basis on sphere up to degree L.
* The basis then consists of N = L.
* @param : L_degree - maximum degree of spherical harmonics basis, 0 <= L <= 1000 (upper bound
* due to numerical stability)
* */
SphericalMonomials
(
unsigned
L_degree
);
/*! @brief : Computes all N = L² +2L basis functions at point (my, phi)
* @param : my = cos(theta) - spherical coordinate, -1 <= x <= 1
* @param : phi - spherical coordinate, 0 <= phi <= 2*pi
* @return : vector of basis functions at point (my, phi) with size N = L² +2L
*/
Vector
ComputeSphericalBasis
(
double
my
,
double
phi
)
override
;
/*! @brief : Computes all N = L² +2L basis functions at point (x, y, z) on the unit sphere
* @param : x,y,z = coordinates on unit sphere
* @return : vector of basis functions at point (x,y,z) with size N = L² +2L
*/
Vector
ComputeSphericalBasis
(
double
x
,
double
y
,
double
z
)
override
;
private:
/*! @brief: maximal degree of the spherical monomial basis (this is "L" in the comments)*/
unsigned
_LMaxDegree
;
/*! @brief: Spatial dimension of the unit sphere (1,2,3) */
unsigned
_spatialDim
;
/*! @brief: spherical monomial basis function vector of
* degree 0 <= l <= L
* length : COmputed with ComputeBasisSize
*/
Vector
_YBasis
;
/*! @brief: Computes the amount of lin. independent monomials of degree degree and
* spatial dimension dim. len of a single oder: (degree + _spatialDim -1) over (degree)
* @return: lenght of a single dimension */
unsigned
ComputeDimensionSize
(
unsigned
degree
);
/*! @brief: Computes the length of the basis vector for a given max degree and
* spatial dimension dim. len of a single oder: (degree + _spatialDim -1) over (degree)
* @return: lenght of whole basis */
unsigned
ComputeBasisSize
(
unsigned
degree
);
/*! @brief: Function to compute factorial of n (n!) in recursive manner */
unsigned
Factorial
(
unsigned
n
);
/*! @brief: Function to compute first component of spherical unit vector
* Omega_x = sqrt(1-my*my)*cos(phi)
* @return: first component of spherical unit vector */
double
Omega_x
(
double
my
,
double
phi
);
/*! @brief: Function to compute first component of spherical unit vector
* Omega_x = sqrt(1-my*my)*sin(phi)
* @return: first component of spherical unit vector */
double
Omega_y
(
double
my
,
double
phi
);
/*! @brief: Function to compute first component of spherical unit vector
* Omega_z = my
* @return: first component of spherical unit vector */
double
Omega_z
(
double
my
);
/*! @brief: Helper Function to compute basis^exponent. */
double
Power
(
double
basis
,
unsigned
exponent
);
};
#endif // SPHERICALMONOMIALS_H
jannick.wolters
@jm2154
mentioned in commit
7345ce36
·
Apr 30, 2021
mentioned in commit
7345ce36
mentioned in commit 7345ce365d864606efb90c7af869298d4afd963f
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment