5#ifndef WAVESIMC_COMPUTATIONAL_HPP
6#define WAVESIMC_COMPUTATIONAL_HPP
16 boost::multi_array<double, 2>
get_profile(
double xmin,
double xmax,
double zmin,
double zmax,
int nx,
int nz,
double r)
18 boost::multi_array<double, 2> c(boost::extents[nx][nz]);
20 boost::multi_array<double, 1> x =
np::linspace(xmin, xmax, nx);
21 boost::multi_array<double, 1> z =
np::linspace(zmin, zmax, nz);
23 const boost::multi_array<double, 1> axis[2] = {x, z};
24 std::vector<boost::multi_array<double, 2>> XZ =
np::meshgrid(axis,
false, np::ij);
26 double x_0 = xmax / 2.0;
27 double z_0 = zmax / 2.0;
29 for (
int i = 0; i < nx; i++)
31 for (
int j = 0; j < nz; j++)
boost::multi_array< double, 2 > get_profile(double xmin, double xmax, double zmin, double zmax, int nx, int nz, double r)
Get the velocity profile of the model as a 2D Array.
::value constexpr boost::multi_array< T, ND > pow(const boost::multi_array< T, ND > &input_array, const T exponent)
Implements the numpy pow function on multi arrays.
::value constexpr std::vector< boost::multi_array< T, ND > > meshgrid(const boost::multi_array< T, 1 >(&cinput)[ND], bool sparsing=false, indexing indexing_type=xy)
boost::multi_array< double, 1 > linspace(double start, double stop, long unsigned int num)
Implements the numpy linspace function.