From 4a43e28560fb7b04bd4b4616028612fe0a9dae94 Mon Sep 17 00:00:00 2001 From: shriwise Date: Thu, 22 Feb 2018 21:13:18 -0600 Subject: [PATCH] Creating a new subclass, CADSurface, with empty definitions for now. --- include/openmc/surface.h | 18 +++++++++++++++++- src/surface.cpp | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/openmc/surface.h b/include/openmc/surface.h index 23d5d15438..0d272de91b 100644 --- a/include/openmc/surface.h +++ b/include/openmc/surface.h @@ -65,7 +65,7 @@ public: std::vector neighbor_neg_; //!< List of cells on negative side explicit Surface(pugi::xml_node surf_node); - + virtual ~Surface() {} //! Determine which side of a surface a point lies on. @@ -110,6 +110,22 @@ protected: virtual void to_hdf5_inner(hid_t group_id) const = 0; }; +//============================================================================== +//! A `Surface` representing a CAD-based surface in DAGMC. +//============================================================================== + +class CADSurface : public Surface +{ + public: + explicit CADSurface(pugi::xml_node surf_node); + double evaluate(const double xyz[3]) const; + double distance(const double xyz[3], const double uvw[3], + bool coincident) const; + void normal(const double xyz[3], double uvw[3]) const; + //! Get the bounding box of this surface. + BoundingBox bounding_box() const; +}; + //============================================================================== //! A `Surface` that supports periodic boundary conditions. //! diff --git a/src/surface.cpp b/src/surface.cpp index d7f523ed64..a8aa8dfb6f 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -239,6 +239,27 @@ Surface::to_hdf5(hid_t group_id) const close_group(surf_group); } +//============================================================================== +// CADSurface implementation +//============================================================================== + + CADSurface::CADSurface(pugi::xml_node surf_node) : Surface {surf_node} {} // empty constructor + +double CADSurface::evaluate(const double xyz[3]) const +{ + return 0.0; +} + +double CADSurface::distance(const double xyz[3], const double uvw[3], bool coincident) const { + return 0.0; +} + +void CADSurface::normal(const double xyz[3], double uvw[3]) const { + return; +} + +BoundingBox CADSurface::bounding_box() const { return BoundingBox(); } + //============================================================================== // PeriodicSurface implementation //==============================================================================