quadgrid 0.1
simple cartesian quad grid with particles for c++/octave
Loading...
Searching...
No Matches
particles.h File Reference
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <quadgrid_config.h>
#include <json.hpp>
#include <map>
#include <quadgrid_cpp.h>
#include <string>
#include "particles_imp.h"

Go to the source code of this file.

Classes

struct  particles_t
 Class to represent particles embedded in a grid. More...
class  ptcl_to_grd_update_t< P2G_t, COORD_t >
 Template class for the update of ptcl_to_grd mapping. More...

Functions

void to_json (nlohmann::json &j, const particles_t &p)
 Adaptor to allow implicit conversion from particles_t to json.

Function Documentation

◆ to_json()

void to_json ( nlohmann::json & j,
const particles_t & p )

Adaptor to allow implicit conversion from particles_t to json.

Definition at line 318 of file particles.cpp.

318 {
319 j = nlohmann::json{
320 {"num_particles", p.num_particles},
321 {"x", p.x},
322 {"y", p.y},
323 {"dprops", p.dprops},
324 {"iprops", p.iprops},
325 {"grid_properties",
326 {{"nx", p.grid.num_cols ()},
327 {"ny", p.grid.num_rows ()},
328 {"hx", p.grid.hx ()},
329 {"hy", p.grid.hy ()}}
330 }
331 };
332}
real_t hy() const
idx_t num_cols() const
idx_t num_rows() const
real_t hx() const
idx_t num_particles
number of particles.
Definition particles.h:34
std::map< std::string, vector_t< idx_t > > iprops
integer type quantities associated with the particles.
Definition particles.h:39
vector_t< real_t > x
x coordinate of particle positions.
Definition particles.h:35
const quadgrid_t< vector_t< real_t > > & grid
refernce to a grid object.
Definition particles.h:48
std::map< std::string, vector_t< real_t > > dprops
double type quantities associated with the particles.
Definition particles.h:42
vector_t< real_t > y
y coordinate of particle positions.
Definition particles.h:36