NDDEM
Public Member Functions | Public Attributes | List of all members
Coarsing Class Reference

Main Coarse graining class. More...

#include <Coarsing.h>

Public Member Functions

 Coarsing (int dd, v1i nnpt, v2d bbox, int T)
 
 ~Coarsing ()
 
int get_id (string nm)
 Find field ID from field name. More...
 
struct Fieldget_field (string nm)
 Find Field from name. More...
 
Pass set_flags (vector< string > s)
 Set the fields which are requested from the coarse-graining. More...
 
int set_field_struct ()
 Set the FIELDS structure, with all the different CG properties that can be computed. More...
 
int add_extra_field (string name, TensorOrder order, FieldType type)
 Used to add extra user-defined fields. More...
 
int setWindow (Windows win, double w, vector< bool > per={}, vector< int > boxes={}, vector< double > deltas={})
 Set the windowing function, calling the templated version. More...
 
template<Windows W>
int setWindow ()
 Set the windowing function. More...
 
template<Windows W>
int setWindow (double w)
 Set the windowing function. More...
 
template<Windows W>
int setWindow (double w, vector< bool > per, vector< int > boxes, vector< double > deltas)
 Set the windowing function for the LibLucyND_Periodic (special one...) More...
 
int grid_generate ()
 Generate the coarse-graining grid. More...
 
int grid_neighbour ()
 Generated neighbors in the coarse-graining grid. More...
 
std::map< std::string, size_t > grid_setfields ()
 Set the fields at each CG point. More...
 
vector< FieldTypegrid_getfields ()
 Extract fields from each CG point. More...
 
v2d get_bounds ()
 Extract the simulation boundaries. More...
 
CGPointreverseloop (string type)
 go through the table in reverse order of the dimensions (for the writing phase essentially) More...
 
int find_closest (int id)
 Find the closest CG point to a particle. More...
 
int find_closest_pq (int id)
 Find the closest CG point to a contact. More...
 
v1d interpolate_vel (int id, bool usetimeavg=false)
 Interpolate the velocity. More...
 
v1d interpolate_rot (int id, bool usetimeavg=false)
 Interpolate the angular velocity. More...
 
v1d interpolate_vel_nearest (int id, bool usetimeavg=false)
 Nearest neighbor interpolation for the velocity. More...
 
v1d interpolate_rot_nearest (int id, bool usetimeavg=false)
 Nearest neighbor interpolation for the angular velocity. More...
 
v1d interpolate_vel_trilinear (int id, bool usetimeavg)
 Tri-linear interpolation (only implemented in 3D, probably not too hard to implement in ND but annoying ...) More...
 
template<int D>
v1d interpolate_vel_multilinear (int id, bool usetimeavg)
 
int idx_FastFirst2SlowFirst (int n)
 Change array traversing order. More...
 
double normdiff (v1d a, v1d b)
 
int pass_1 ()
 convenience function to to the difference of 2 vectors. More...
 
int pass_2 (bool usetimeavg=false)
 Coarse-grain anything based on particles (not contacts) which needs fluctuating quantities (call the compute_fluc_ functions before) More...
 
int pass_3 ()
 Coarse-grain anything based on contact informations (no fluctuations). More...
 
int pass_4 ()
 Coarse-grain anything based on contact informations & fluctuations. More...
 
int pass_5 ()
 Calculation of derived quantities. More...
 
int compute_fluc_vel (bool usetimeavg=false)
 Velocity fluctuation computation. More...
 
int compute_fluc_rot (bool usetimeavg=false)
 Angular velocity fluctuation computation. More...
 
int mean_time (bool temporary=false)
 Perform a time average of the coarse-grained data. More...
 
int write_vtk (string sout)
 Write CG data as VTK. More...
 
int write_netCDF (string sout)
 
int write_NrrdIO (string path)
 Write CG data as NrrdIO file format. More...
 
int write_matlab (string path, bool squeeze=false)
 Write CG data as Matlab file. More...
 
int write_numpy (string path, bool squeeze=false)
 Write CG data as numpy files (.npy) ;. More...
 
int write_numpy_npy (string path, bool squeeze)
 
std::pair< size_t, uint8_t * > write_numpy_locbuffer (bool squeeze)
 
std::pair< size_t, uint8_t * > write_numpy_buffer (int id, bool squeeze)
 

Public Attributes

int d
 Number of dimensions. More...
 
int Npt
 Number of coarse graining points. More...
 
int Time
 Total timesteps. More...
 
int cT
 Current timestep. More...
 
double cutoff
 CG width, and cutoff. More...
 
vector< CGPointCGP
 List of Coarse Graining points. More...
 
vector< CGPoint > * CGPtemp = nullptr
 Temporary cgpoint list that can store temporal averages if needed. More...
 
vector< int > npt
 Number of points per dimension. More...
 
vector< int > nptcum
 Cumulated number of points per dimensions (usefull for quick finding of the closest CG for a grain) More...
 
v1d dx
 Distances between CG points. More...
 
v2d box
 CG point location. More...
 
LibBaseWindow = nullptr
 
unsigned int flags
 

Pointer to the averaging window

More...
 
vector< string > Fields
 
vector< string > Fname
 Flagged field names. More...
 
vector< int > Fidx
 Where the fields is referenced in the fields vector in the CGPoint. -1 if not flagged. More...
 
vector< TensorOrderFtype
 Flagged field types. More...
 
vector< struct FieldFIELDS
 All allowed fields (initialized in grid_getfields) More...
 
bool hasvelfluct =false
 
bool hasrotfluct =false
 
struct Data data
 Data storage. More...
 

Detailed Description

Main Coarse graining class.


The documentation for this class was generated from the following files: