Medusa  1.1
Coordinate Free Mehless Method implementation
mm::discretization_helpers::SphereDiscretization< scalar_t, dim > Struct Template Reference

#include <discretization_helpers.hpp>

Detailed Description

template<typename scalar_t, int dim>
struct mm::discretization_helpers::SphereDiscretization< scalar_t, dim >

Discretizes a sphere with given radius uniformly with num_points points on the great circle.

This is a class because C++ does not allow partial template specializations of functions.

Template Parameters
dimDimension of the sphere.
scalar_tData type for numeric computations, e.g. double or float.
std::mt19937 gen;
double r = 2.3;
const int dim = 1;

Definition at line 75 of file discretization_helpers.hpp.

Static Public Member Functions

template<typename generator_t >
static std::vector< Eigen::Matrix< scalar_t, dim, 1 >, Eigen::aligned_allocator< Eigen::Matrix< scalar_t, dim, 1 > > > construct (scalar_t radius, int num_samples, generator_t &generator)
 Construct a randomized discretization. More...
 
static std::vector< Eigen::Matrix< scalar_t, dim, 1 >, Eigen::aligned_allocator< Eigen::Matrix< scalar_t, dim, 1 > > > construct (scalar_t radius, int num_samples)
 Construct the discretization. More...
 

Member Function Documentation

◆ construct() [1/2]

template<typename scalar_t , int dim>
static std::vector<Eigen::Matrix<scalar_t, dim, 1>, Eigen::aligned_allocator<Eigen::Matrix<scalar_t, dim, 1> > > mm::discretization_helpers::SphereDiscretization< scalar_t, dim >::construct ( scalar_t  radius,
int  num_samples 
)
inlinestatic

Construct the discretization.

Definition at line 110 of file discretization_helpers.hpp.

◆ construct() [2/2]

template<typename scalar_t , int dim>
template<typename generator_t >
static std::vector<Eigen::Matrix<scalar_t, dim, 1>, Eigen::aligned_allocator<Eigen::Matrix<scalar_t, dim, 1> > > mm::discretization_helpers::SphereDiscretization< scalar_t, dim >::construct ( scalar_t  radius,
int  num_samples,
generator_t &  generator 
)
inlinestatic

Construct a randomized discretization.

Parameters
radiusRadius of the sphere.
num_samplesNumber of points on the equator, implies nodal spacing dp = 2*pi*r/n.
generatorA random number generator.
Returns
A vector of discretization points.
Examples
test/domains/discretization_helpers_test.cpp.

Definition at line 85 of file discretization_helpers.hpp.


The documentation for this struct was generated from the following file:
dim
@ dim
Number of elements of this matrix.
Definition: MatrixBaseAddons.hpp:14
mm::discretization_helpers::SphereDiscretization::construct
static std::vector< Eigen::Matrix< scalar_t, dim, 1 >, Eigen::aligned_allocator< Eigen::Matrix< scalar_t, dim, 1 > > > construct(scalar_t radius, int num_samples, generator_t &generator)
Construct a randomized discretization.
Definition: discretization_helpers.hpp:85