diff --git a/src/cell.cpp b/src/cell.cpp index 798935358..554ca74f1 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -429,7 +429,7 @@ Cell::contains_complex(Position r, Direction u, int32_t on_surface) const //============================================================================== extern "C" void -read_cells(pugi::xml_node *node) +read_cells(pugi::xml_node* node) { // Count the number of cells. for (pugi::xml_node cell_node: node->children("cell")) {n_cells++;} @@ -467,35 +467,35 @@ read_cells(pugi::xml_node *node) extern "C" { Cell* cell_pointer(int32_t cell_ind) {return global_cells[cell_ind];} - int32_t cell_id(Cell *c) {return c->id;} + int32_t cell_id(Cell* c) {return c->id;} - void cell_set_id(Cell *c, int32_t id) {c->id = id;} + void cell_set_id(Cell* c, int32_t id) {c->id = id;} - int cell_type(Cell *c) {return c->type;} + int cell_type(Cell* c) {return c->type;} - void cell_set_type(Cell *c, int type) {c->type = type;} + void cell_set_type(Cell* c, int type) {c->type = type;} - int32_t cell_universe(Cell *c) {return c->universe;} + int32_t cell_universe(Cell* c) {return c->universe;} - void cell_set_universe(Cell *c, int32_t universe) {c->universe = universe;} + void cell_set_universe(Cell* c, int32_t universe) {c->universe = universe;} - int32_t cell_fill(Cell *c) {return c->fill;} + int32_t cell_fill(Cell* c) {return c->fill;} - int32_t* cell_fill_ptr(Cell *c) {return &c->fill;} + int32_t* cell_fill_ptr(Cell* c) {return &c->fill;} - int32_t cell_n_instances(Cell *c) {return c->n_instances;} + int32_t cell_n_instances(Cell* c) {return c->n_instances;} - bool cell_simple(Cell *c) {return c->simple;} + bool cell_simple(Cell* c) {return c->simple;} - bool cell_contains(Cell *c, double xyz[3], double uvw[3], int32_t on_surface) + bool cell_contains(Cell* c, double xyz[3], double uvw[3], int32_t on_surface) { Position r {xyz}; Direction u {uvw}; return c->contains(r, u, on_surface); } - void cell_distance(Cell *c, double xyz[3], double uvw[3], int32_t on_surface, - double *min_dist, int32_t *i_surf) + void cell_distance(Cell* c, double xyz[3], double uvw[3], int32_t on_surface, + double* min_dist, int32_t* i_surf) { Position r {xyz}; Direction u {uvw}; @@ -504,9 +504,9 @@ extern "C" { *i_surf = out.second; } - int32_t cell_offset(Cell *c, int map) {return c->offset[map];} + int32_t cell_offset(Cell* c, int map) {return c->offset[map];} - void cell_to_hdf5(Cell *c, hid_t group) {c->to_hdf5(group);} + void cell_to_hdf5(Cell* c, hid_t group) {c->to_hdf5(group);} void extend_cells_c(int32_t n) { diff --git a/src/surface.cpp b/src/surface.cpp index 261a8d7d2..99cfd82b0 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -27,7 +27,7 @@ extern "C" const int BC_PERIODIC {3}; int32_t n_surfaces; -Surface **surfaces_c; +Surface** surfaces_c; std::map surface_map; @@ -298,8 +298,8 @@ void SurfaceXPlane::to_hdf5_inner(hid_t group_id) const write_dataset(group_id, "coefficients", coeffs); } -bool SurfaceXPlane::periodic_translate(const PeriodicSurface *other, Position& r, - Direction& u) const +bool SurfaceXPlane::periodic_translate(const PeriodicSurface* other, + Position& r, Direction& u) const { Direction other_n = other->normal(r); if (other_n.x == 1 and other_n.y == 0 and other_n.z == 0) { @@ -359,8 +359,8 @@ void SurfaceYPlane::to_hdf5_inner(hid_t group_id) const write_dataset(group_id, "coefficients", coeffs); } -bool SurfaceYPlane::periodic_translate(const PeriodicSurface *other, Position& r, - Direction& u) const +bool SurfaceYPlane::periodic_translate(const PeriodicSurface *other, + Position& r, Direction& u) const { Direction other_n = other->normal(r); if (other_n.x == 0 and other_n.y == 1 and other_n.z == 0) { @@ -421,8 +421,8 @@ void SurfaceZPlane::to_hdf5_inner(hid_t group_id) const write_dataset(group_id, "coefficients", coeffs); } -bool SurfaceZPlane::periodic_translate(const PeriodicSurface *other, Position& r, - Direction& u) const +bool SurfaceZPlane::periodic_translate(const PeriodicSurface* other, + Position& r, Direction& u) const { // Assume the other plane is aligned along z. Just change the z coord. r.z = z0; @@ -478,7 +478,7 @@ void SurfacePlane::to_hdf5_inner(hid_t group_id) const write_dataset(group_id, "coefficients", coeffs); } -bool SurfacePlane::periodic_translate(const PeriodicSurface *other, Position& r, +bool SurfacePlane::periodic_translate(const PeriodicSurface* other, Position& r, Direction& u) const { // This function assumes the other plane shares this plane's normal direction. @@ -1023,7 +1023,7 @@ void SurfaceQuadric::to_hdf5_inner(hid_t group_id) const //============================================================================== extern "C" void -read_surfaces(pugi::xml_node *node) +read_surfaces(pugi::xml_node* node) { // Count the number of surfaces. for (pugi::xml_node surf_node: node->children("surface")) {n_surfaces++;} @@ -1106,8 +1106,8 @@ read_surfaces(pugi::xml_node *node) for (int i_surf = 0; i_surf < n_surfaces; i_surf++) { if (surfaces_c[i_surf]->bc == BC_PERIODIC) { // Downcast to the PeriodicSurface type. - Surface *surf_base = surfaces_c[i_surf]; - PeriodicSurface *surf = dynamic_cast(surf_base); + Surface* surf_base = surfaces_c[i_surf]; + PeriodicSurface* surf = dynamic_cast(surf_base); // Make sure this surface inherits from PeriodicSurface. if (!surf) { @@ -1151,12 +1151,12 @@ read_surfaces(pugi::xml_node *node) for (int i_surf = 0; i_surf < n_surfaces; i_surf++) { if (surfaces_c[i_surf]->bc == BC_PERIODIC) { // Downcast to the PeriodicSurface type. - Surface *surf_base = surfaces_c[i_surf]; - PeriodicSurface *surf = dynamic_cast(surf_base); + Surface* surf_base = surfaces_c[i_surf]; + PeriodicSurface* surf = dynamic_cast(surf_base); // Also try downcasting to the SurfacePlane type (which must be handled // differently). - SurfacePlane *surf_p = dynamic_cast(surf); + SurfacePlane* surf_p = dynamic_cast(surf); if (!surf_p) { // This is not a SurfacePlane. @@ -1215,11 +1215,11 @@ read_surfaces(pugi::xml_node *node) extern "C" { Surface* surface_pointer(int surf_ind) {return surfaces_c[surf_ind];} - int surface_id(Surface *surf) {return surf->id;} + int surface_id(Surface* surf) {return surf->id;} - int surface_bc(Surface *surf) {return surf->bc;} + int surface_bc(Surface* surf) {return surf->bc;} - void surface_reflect(Surface *surf, double xyz[3], double uvw[3]) + void surface_reflect(Surface* surf, double xyz[3], double uvw[3]) { Position r {xyz}; Direction u {uvw}; @@ -1230,7 +1230,7 @@ extern "C" { uvw[2] = u.z; } - void surface_normal(Surface *surf, double xyz[3], double uvw[3]) + void surface_normal(Surface* surf, double xyz[3], double uvw[3]) { Position r {xyz}; Direction u = surf->normal(r); @@ -1239,12 +1239,12 @@ extern "C" { uvw[2] = u.z; } - void surface_to_hdf5(Surface *surf, hid_t group) {surf->to_hdf5(group);} + void surface_to_hdf5(Surface* surf, hid_t group) {surf->to_hdf5(group);} - int surface_i_periodic(PeriodicSurface *surf) {return surf->i_periodic;} + int surface_i_periodic(PeriodicSurface* surf) {return surf->i_periodic;} bool - surface_periodic(PeriodicSurface *surf, PeriodicSurface *other, double xyz[3], + surface_periodic(PeriodicSurface* surf, PeriodicSurface* other, double xyz[3], double uvw[3]) { Position r {xyz}; diff --git a/src/surface.h b/src/surface.h index d4e6c0230..d43b24ae0 100644 --- a/src/surface.h +++ b/src/surface.h @@ -31,7 +31,7 @@ extern "C" const int BC_PERIODIC; extern "C" int32_t n_surfaces; class Surface; -extern Surface **surfaces_c; +extern Surface** surfaces_c; extern std::map surface_map; @@ -131,7 +131,7 @@ public: //! periodicity. //! \return true if this surface and its partner make a rotationally-periodic //! boundary condition. - virtual bool periodic_translate(const PeriodicSurface *other, Position& r, + virtual bool periodic_translate(const PeriodicSurface* other, Position& r, Direction& u) const = 0; //! Get the bounding box for this surface. @@ -153,8 +153,8 @@ public: double distance(Position r, Direction u, bool coincident) const; Direction normal(Position r) const; void to_hdf5_inner(hid_t group_id) const; - bool periodic_translate(const PeriodicSurface *other, Position& r, Direction& u) - const; + bool periodic_translate(const PeriodicSurface* other, Position& r, + Direction& u) const; BoundingBox bounding_box() const; }; @@ -173,8 +173,8 @@ public: double distance(Position r, Direction u, bool coincident) const; Direction normal(Position r) const; void to_hdf5_inner(hid_t group_id) const; - bool periodic_translate(const PeriodicSurface *other, Position& r, Direction& u) - const; + bool periodic_translate(const PeriodicSurface* other, Position& r, + Direction& u) const; BoundingBox bounding_box() const; }; @@ -193,8 +193,8 @@ public: double distance(Position r, Direction u, bool coincident) const; Direction normal(Position r) const; void to_hdf5_inner(hid_t group_id) const; - bool periodic_translate(const PeriodicSurface *other, Position& r, Direction& u) - const; + bool periodic_translate(const PeriodicSurface* other, Position& r, + Direction& u) const; BoundingBox bounding_box() const; }; @@ -213,8 +213,8 @@ public: double distance(Position r, Direction u, bool coincident) const; Direction normal(Position r) const; void to_hdf5_inner(hid_t group_id) const; - bool periodic_translate(const PeriodicSurface *other, Position& r, Direction& u) - const; + bool periodic_translate(const PeriodicSurface* other, Position& r, + Direction& u) const; BoundingBox bounding_box() const; }; @@ -368,16 +368,16 @@ public: extern "C" { Surface* surface_pointer(int surf_ind); - int surface_id(Surface *surf); - int surface_bc(Surface *surf); - bool surface_sense(Surface *surf, double xyz[3], double uvw[3]); - void surface_reflect(Surface *surf, double xyz[3], double uvw[3]); - double surface_distance(Surface *surf, double xyz[3], double uvw[3], + int surface_id(Surface* surf); + int surface_bc(Surface* surf); + bool surface_sense(Surface* surf, double xyz[3], double uvw[3]); + void surface_reflect(Surface* surf, double xyz[3], double uvw[3]); + double surface_distance(Surface* surf, double xyz[3], double uvw[3], bool coincident); - void surface_normal(Surface *surf, double xyz[3], double uvw[3]); - void surface_to_hdf5(Surface *surf, hid_t group); - int surface_i_periodic(PeriodicSurface *surf); - bool surface_periodic(PeriodicSurface *surf, PeriodicSurface *other, + void surface_normal(Surface* surf, double xyz[3], double uvw[3]); + void surface_to_hdf5(Surface* surf, hid_t group); + int surface_i_periodic(PeriodicSurface* surf); + bool surface_periodic(PeriodicSurface* surf, PeriodicSurface* other, double xyz[3], double uvw[3]); void free_memory_surfaces_c(); }