mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Add PointCloud spatial distribution (#3161)
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
0ecd45c906
commit
58400cbf10
9 changed files with 306 additions and 12 deletions
|
|
@ -136,6 +136,26 @@ private:
|
|||
//!< mesh element indices
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
//! Distribution of points
|
||||
//==============================================================================
|
||||
|
||||
class PointCloud : public SpatialDistribution {
|
||||
public:
|
||||
explicit PointCloud(pugi::xml_node node);
|
||||
explicit PointCloud(
|
||||
std::vector<Position> point_cloud, gsl::span<const double> strengths);
|
||||
|
||||
//! Sample a position from the distribution
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled position
|
||||
Position sample(uint64_t* seed) const override;
|
||||
|
||||
private:
|
||||
std::vector<Position> point_cloud_;
|
||||
DiscreteIndex point_idx_dist_; //!< Distribution of Position indices
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
//! Uniform distribution of points over a box
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ xt::xarray<T> get_node_xarray(
|
|||
return xt::adapt(v, shape);
|
||||
}
|
||||
|
||||
std::vector<Position> get_node_position_array(
|
||||
pugi::xml_node node, const char* name, bool lowercase = false);
|
||||
|
||||
Position get_node_position(
|
||||
pugi::xml_node node, const char* name, bool lowercase = false);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue