1#include <boost/multi_array.hpp>
2#include <boost/array.hpp>
3#include "CustomLibraries/np.hpp"
4#include "CustomLibraries/np_to_matplot.hpp"
5#include "CustomLibraries/wavePlotter.hpp"
6#include <matplot/matplot.h>
11#include "CoreAlgorithm/helper_func.hpp"
12#include "CoreAlgorithm/coeff.hpp"
13#include "CoreAlgorithm/source.hpp"
14#include "CoreAlgorithm/computational.hpp"
15#include "CoreAlgorithm/solver.hpp"
34 double xmax = nx * dx;
36 double zmax = nz * dz;
38 double tmax = nt * dt;
50 boost::multi_array<double, 3> f =
waveSimCore::ricker(source_is, source_js, f_M, amp, shift, tmin, tmax, nt, nx, nz);
64 std::vector<double> levels = matplot::linspace(min_u, max_u, num_levels);
67 boost::multi_array<double, 1> x =
np::linspace(xmin, xmax, nx);
68 boost::multi_array<double, 1> z =
np::linspace(zmin, zmax, nz);
69 const boost::multi_array<double, 1> axis[2] = {x, z};
70 std::vector<boost::multi_array<double, 2>> XcZ =
np::meshgrid(axis,
false, np::xy);
83 int end_frame = nt - 1;
85 my_plotter.animate(
"example-wave.mp4", start_frame, end_frame, fps);
This class is used to plot the wave field TODO: make it multithreaded.
matplot::vector_2d convert_to_matplot(const boost::multi_array< double, 2 > &arr)
Convert a 2D boost::multi_array to a matplot::vector_2d.
boost::multi_array< double, 3 > ricker(int i_s, int j_s, double f, double amp, double shift, double tmin, double tmax, int nt, int nx, int nz)
Get the Ricker wavelet as a 3D Array.
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.
boost::multi_array< double, 3 > wave_solver(boost::multi_array< double, 2 > c, double dt, double dx, double dz, int nt, int nx, int nz, boost::multi_array< double, 3 > f)
::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.
::value constexpr T min(boost::multi_array< T, ND > const &input_array)
Implements the numpy min function for an n-dimensionl multi array.
::value constexpr T max(boost::multi_array< T, ND > const &input_array)
Implements the numpy max function for an n-dimensionl multi array.