|
Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
|
#include <grid.h>
Public Member Functions | |
| Grid () | |
| Grid (size_t N) | |
| Grid (size_t N, T yini) | |
| T * | get_y () |
| T const * | get_y () const |
| const std::vector< T > & | get_vec () const |
| T & | operator[] (size_t i) |
| const T & | operator[] (size_t i) const |
| T | get_y (size_t i) |
| void | set_y (std::vector< T > &y) |
| void | set_y (size_t i, T &value) |
| std::vector< size_t > | index_list (size_t i) |
| size_t | get_N () const |
| size_t | get_Ntot () const |
| size_t | grid_index (std::vector< size_t > &index_list) |
| size_t | grid_index_3d (size_t ix, size_t iy, size_t iz) |
| size_t | grid_index_2d (size_t ix, size_t iy) |
| void | dump_to_file (std::string filename) |
| void | read_from_file (std::string filename) |
| double | max () |
| double | min () |
| void | clear () |
| template<size_t NNDIM, typename TT > | |
| Grid< NNDIM, TT > & | operator+= (const Grid< NNDIM, TT > &rhs) |
| template<size_t NNDIM, typename TT > | |
| Grid< NNDIM, TT > & | operator-= (const Grid< NNDIM, TT > &rhs) |
| template<size_t NNDIM, typename TT > | |
| Grid< NNDIM, TT > & | operator*= (const Grid< NNDIM, TT > &rhs) |
| template<size_t NNDIM, typename TT > | |
| Grid< NNDIM, TT > & | operator/= (const Grid< NNDIM, TT > &rhs) |
| Grid< NDIM, T > & | operator*= (const T &rhs) |
| Grid< NDIM, T > & | operator/= (const T &rhs) |
| double | rms_norm () |
| void | check_for_nan (bool exitifnan) |
Private Attributes | |
| size_t | _N |
| size_t | _Ntot |
| std::vector< T > | _y |
Definition at line 33 of file grid.h.
References Grid< NDIM, T >::dump_to_file(), Grid< NDIM, T >::get_N(), Grid< NDIM, T >::get_Ntot(), Grid< NDIM, T >::get_vec(), Grid< NDIM, T >::get_y(), Grid< NDIM, T >::Grid(), Grid< NDIM, T >::grid_index(), Grid< NDIM, T >::grid_index_2d(), Grid< NDIM, T >::grid_index_3d(), Grid< NDIM, T >::index_list(), mfunc_bm::iz, Grid< NDIM, T >::operator[](), Grid< NDIM, T >::read_from_file(), Grid< NDIM, T >::set_y(), growth_allz::T, and Catch::Generators::value().
| void Grid< NDIM, T >::check_for_nan | ( | bool | exitifnan | ) |
Definition at line 20 of file grid.cpp.
Referenced by Grid< NDIM, T >::operator/=().
| void Grid< NDIM, T >::clear | ( | ) |
Definition at line 197 of file grid.cpp.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
Referenced by Grid< NDIM, T >::min().
| void Grid< NDIM, T >::dump_to_file | ( | std::string | filename | ) |
Definition at line 147 of file grid.cpp.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::_y, and growth_allz::T.
Referenced by assign_to_grid(), and Grid< NDIM, T >::Grid().
| size_t Grid< NDIM, T >::get_N | ( | ) | const |
Definition at line 135 of file grid.cpp.
References Grid< NDIM, T >::_N.
Referenced by assign_to_grid(), compute_v(), Grid< NDIM, T >::Grid(), main(), MultiGrid< NDIM, T >::MultiGrid(), MultiGrid< NDIM, T >::restrict_down(), solve_with_fft(), anonymous_namespace{chameleon.cpp}::transform_Grid_to_Mesh(), and anonymous_namespace{chameleon.cpp}::transform_Mesh_to_Grid().
| size_t Grid< NDIM, T >::get_Ntot | ( | ) | const |
Definition at line 141 of file grid.cpp.
References Grid< NDIM, T >::_Ntot.
Referenced by assign_to_grid(), compute_v(), anonymous_namespace{chameleon.cpp}::ChiSolver< T >::correct_sol(), Grid< NDIM, T >::Grid(), MultiGridSolver< NDIM, T >::make_prolongation_array(), solve_with_fft(), sqrt(), anonymous_namespace{chameleon.cpp}::transform_Grid_to_Mesh(), and anonymous_namespace{chameleon.cpp}::transform_Mesh_to_Grid().
| const std::vector< T > & Grid< NDIM, T >::get_vec | ( | ) | const |
Definition at line 51 of file grid.cpp.
References Grid< NDIM, T >::_y.
Referenced by Grid< NDIM, T >::Grid(), and anonymous_namespace{chameleon.cpp}::min().
| T * Grid< NDIM, T >::get_y | ( | ) |
Definition at line 41 of file grid.cpp.
References Grid< NDIM, T >::_y.
Referenced by assign_to_grid(), Grid< NDIM, T >::Grid(), MultiGrid< NDIM, T >::restrict_down(), MultiGridSolver< NDIM, T >::set_initial_guess(), and set_rho().
| T const * Grid< NDIM, T >::get_y | ( | ) | const |
| T Grid< NDIM, T >::get_y | ( | size_t | i | ) |
Definition at line 75 of file grid.cpp.
References Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
| size_t Grid< NDIM, T >::grid_index | ( | std::vector< size_t > & | index_list | ) |
Definition at line 112 of file grid.cpp.
References Grid< NDIM, T >::_N, and Grid< NDIM, T >::_Ntot.
Referenced by Grid< NDIM, T >::Grid().
| size_t Grid< NDIM, T >::grid_index_2d | ( | size_t | ix, |
| size_t | iy | ||
| ) |
Definition at line 130 of file grid.cpp.
References Grid< NDIM, T >::_N.
Referenced by Grid< NDIM, T >::Grid().
| size_t Grid< NDIM, T >::grid_index_3d | ( | size_t | ix, |
| size_t | iy, | ||
| size_t | iz | ||
| ) |
Definition at line 124 of file grid.cpp.
References Grid< NDIM, T >::_N, and mfunc_bm::iz.
Referenced by compute_v(), and Grid< NDIM, T >::Grid().
| std::vector< size_t > Grid< NDIM, T >::index_list | ( | size_t | i | ) |
Definition at line 102 of file grid.cpp.
References Grid< NDIM, T >::_N.
Referenced by compute_v(), and Grid< NDIM, T >::Grid().
Definition at line 71 of file grid.h.
References Grid< NDIM, T >::_Ntot, and sqrt().
Referenced by main().
Definition at line 84 of file grid.h.
References Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::clear(), and sqrt().
Referenced by main().
|
inline |
Definition at line 129 of file grid.h.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
Definition at line 156 of file grid.h.
References Grid< NDIM, T >::_Ntot.
|
inline |
Definition at line 101 of file grid.h.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
|
inline |
Definition at line 115 of file grid.h.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
|
inline |
Definition at line 143 of file grid.h.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
Definition at line 166 of file grid.h.
References Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::check_for_nan(), and Grid< NDIM, T >::rms_norm().
| T & Grid< NDIM, T >::operator[] | ( | size_t | i | ) |
Definition at line 58 of file grid.cpp.
References Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
Referenced by Grid< NDIM, T >::Grid().
| const T & Grid< NDIM, T >::operator[] | ( | size_t | i | ) | const |
Definition at line 66 of file grid.cpp.
References Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
| void Grid< NDIM, T >::read_from_file | ( | std::string | filename | ) |
Definition at line 165 of file grid.cpp.
References Grid< NDIM, T >::_N, Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::_y, power(), and growth_allz::T.
Referenced by Grid< NDIM, T >::Grid(), and main().
Definition at line 238 of file grid.h.
References Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::_y, and sqrt().
Referenced by MultiGridSolver< NDIM, T >::calculate_residual(), main(), and Grid< NDIM, T >::operator/=().
| void Grid< NDIM, T >::set_y | ( | std::vector< T > & | y | ) |
Definition at line 84 of file grid.cpp.
References Grid< NDIM, T >::_Ntot, and Grid< NDIM, T >::_y.
Referenced by Grid< NDIM, T >::Grid().
| void Grid< NDIM, T >::set_y | ( | size_t | i, |
| T & | value | ||
| ) |
Definition at line 93 of file grid.cpp.
References Grid< NDIM, T >::_Ntot, Grid< NDIM, T >::_y, and Catch::Generators::value().
|
private |
Definition at line 25 of file grid.h.
Referenced by Grid< NDIM, T >::clear(), Grid< NDIM, T >::dump_to_file(), Grid< NDIM, T >::get_N(), Grid< NDIM, T >::grid_index(), Grid< NDIM, T >::grid_index_2d(), Grid< NDIM, T >::grid_index_3d(), Grid< NDIM, T >::index_list(), Grid< NDIM, T >::operator*=(), Grid< NDIM, T >::operator+=(), Grid< NDIM, T >::operator-=(), Grid< NDIM, T >::operator/=(), and Grid< NDIM, T >::read_from_file().
|
private |
Definition at line 26 of file grid.h.
Referenced by Grid< NDIM, T >::clear(), Grid< NDIM, T >::dump_to_file(), Grid< NDIM, T >::get_Ntot(), Grid< NDIM, T >::get_y(), Grid< NDIM, T >::grid_index(), Grid< NDIM, T >::max(), Grid< NDIM, T >::min(), Grid< NDIM, T >::operator*=(), Grid< NDIM, T >::operator+=(), Grid< NDIM, T >::operator-=(), Grid< NDIM, T >::operator/=(), Grid< NDIM, T >::operator[](), Grid< NDIM, T >::read_from_file(), Grid< NDIM, T >::rms_norm(), and Grid< NDIM, T >::set_y().
|
private |
Definition at line 27 of file grid.h.
Referenced by Grid< NDIM, T >::clear(), Grid< NDIM, T >::dump_to_file(), Grid< NDIM, T >::get_vec(), Grid< NDIM, T >::get_y(), Grid< NDIM, T >::operator*=(), Grid< NDIM, T >::operator+=(), Grid< NDIM, T >::operator-=(), Grid< NDIM, T >::operator/=(), Grid< NDIM, T >::operator[](), Grid< NDIM, T >::read_from_file(), Grid< NDIM, T >::rms_norm(), and Grid< NDIM, T >::set_y().