diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Laser/LaserProfiles.H | 42 | ||||
-rw-r--r-- | Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp | 6 |
2 files changed, 38 insertions, 10 deletions
diff --git a/Source/Laser/LaserProfiles.H b/Source/Laser/LaserProfiles.H index 85a311688..f97bf915e 100644 --- a/Source/Laser/LaserProfiles.H +++ b/Source/Laser/LaserProfiles.H @@ -320,17 +320,39 @@ private: */ void read_data_t_chuck(int t_begin, int t_end); + /** + * \brief m_params contains all the internal parameters + * used by this laser profile + */ struct{ - std::string txye_file_name; //Name of the file containing the data - bool is_grid_uniform = false; //Flag to store if the grid is uniform - int nt, nx, ny; //Dimensions of E_data - amrex::Gpu::ManagedVector<amrex::Real> t_coords; //Vector of temporal coordinates - amrex::Gpu::ManagedVector<amrex::Real> x_coords; //Vector of x coordinates - amrex::Gpu::ManagedVector<amrex::Real> y_coords; //Vector of y coordinates - int time_chunk_size; //Size of the timestep range to load - int first_time_index; //Index of the first timestep in memory - int last_time_index; //Index of the last timestep in memory - amrex::Gpu::ManagedVector<amrex::Real> E_data; //Field data + /** Name of the file containing the data */ + std::string txye_file_name; + /** Flag to store if the grid is uniform */ + bool is_grid_uniform = false; + /** Dimensions of E_data. nt, nx must be >=2. + * If DIM=3, ny must be >=2 as well. + * If DIM=2, ny must be 1 */ + int nt, nx, ny; + /** Vector of temporal coordinates. For a non-uniform grid, it contains + * all values of time. For a uniform grid, it contains only the start and stop + * times and intermediate times are obtained with nt */ + amrex::Gpu::ManagedVector<amrex::Real> t_coords; + /** Vector or x coordinates. For a non-uniform grid, it contains all values + * of space dimension x. For a uniform grid, it contains only the min and max + * x coordinates, and intermediate positions are obtained with nx */ + amrex::Gpu::ManagedVector<amrex::Real> x_coords; + /** Vector or y coordinates. For a non-uniform grid, it contains all values + * of space dimension y. For a uniform grid, it contains only the min and max + * y coordinates, and intermediate positions are obtained with ny */ + amrex::Gpu::ManagedVector<amrex::Real> y_coords; + /** Size of the timestep range to load */ + int time_chunk_size; + /** Index of the first timestep in memory */ + int first_time_index; + /** Index of the last timestep in memory */ + int last_time_index; + /** Field data */ + amrex::Gpu::ManagedVector<amrex::Real> E_data; } m_params; CommonLaserParameters m_common_params; diff --git a/Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp b/Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp index d6155e70b..855065f92 100644 --- a/Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp +++ b/Source/Laser/LaserProfilesImpl/LaserProfileFromTXYEFile.cpp @@ -190,6 +190,12 @@ FromTXYEFileLaserProfile::parse_txye_file(std::string txye_file_name) m_params.is_grid_uniform = is_grid_uniform; //Broadcast grid size and coordinate sizes + //When a non-uniform grid is used, nt, nx and ny are identical + //to t_coords.size(), x_coords.size() and y_coords.size(). + //When a uniform grid is used, nt,nx and ny store the number of points + //used for the mesh, while t_coords, x_coords and y_coords store the + //extrems in each direaction. Thus t_coords and x_coords in this case + //have size 2 and y_coords has size 1 in 2D and size 2 in 3D. int t_sizes[6] = {m_params.nt, m_params.nx, m_params.ny, static_cast<int>(m_params.t_coords.size()), static_cast<int>(m_params.x_coords.size()), |