mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Block restriction of libMesh unstructured mesh tallies (#3694)
This commit is contained in:
parent
51ea89ccc8
commit
5847b0de23
2 changed files with 70 additions and 20 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#ifndef OPENMC_MESH_H
|
||||
#define OPENMC_MESH_H
|
||||
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "hdf5.h"
|
||||
|
|
@ -969,7 +970,7 @@ public:
|
|||
|
||||
Position sample_element(int32_t bin, uint64_t* seed) const override;
|
||||
|
||||
int get_bin(Position r) const override;
|
||||
virtual int get_bin(Position r) const override;
|
||||
|
||||
int n_bins() const override;
|
||||
|
||||
|
|
@ -1007,16 +1008,21 @@ public:
|
|||
|
||||
protected:
|
||||
// Methods
|
||||
|
||||
//! Translate a bin value to an element reference
|
||||
virtual const libMesh::Elem& get_element_from_bin(int bin) const;
|
||||
|
||||
//! Translate an element pointer to a bin index
|
||||
virtual int get_bin_from_element(const libMesh::Elem* elem) const;
|
||||
|
||||
// Data members
|
||||
libMesh::MeshBase* m_; //!< pointer to libMesh MeshBase instance, always set
|
||||
//!< during intialization
|
||||
vector<unique_ptr<libMesh::PointLocatorBase>>
|
||||
pl_; //!< per-thread point locators
|
||||
libMesh::BoundingBox bbox_; //!< bounding box of the mesh
|
||||
|
||||
private:
|
||||
// Methods
|
||||
void initialize() override;
|
||||
void set_mesh_pointer_from_filename(const std::string& filename);
|
||||
void build_eqn_sys();
|
||||
|
|
@ -1025,8 +1031,6 @@ private:
|
|||
unique_ptr<libMesh::MeshBase> unique_m_ =
|
||||
nullptr; //!< pointer to the libMesh MeshBase instance, only used if mesh is
|
||||
//!< created inside OpenMC
|
||||
vector<unique_ptr<libMesh::PointLocatorBase>>
|
||||
pl_; //!< per-thread point locators
|
||||
unique_ptr<libMesh::EquationSystems>
|
||||
equation_systems_; //!< pointer to the libMesh EquationSystems
|
||||
//!< instance
|
||||
|
|
@ -1035,7 +1039,6 @@ private:
|
|||
std::unordered_map<std::string, unsigned int>
|
||||
variable_map_; //!< mapping of variable names (tally scores) to libMesh
|
||||
//!< variable numbers
|
||||
libMesh::BoundingBox bbox_; //!< bounding box of the mesh
|
||||
libMesh::dof_id_type
|
||||
first_element_id_; //!< id of the first element in the mesh
|
||||
};
|
||||
|
|
@ -1043,8 +1046,9 @@ private:
|
|||
class AdaptiveLibMesh : public LibMesh {
|
||||
public:
|
||||
// Constructor
|
||||
AdaptiveLibMesh(
|
||||
libMesh::MeshBase& input_mesh, double length_multiplier = 1.0);
|
||||
AdaptiveLibMesh(libMesh::MeshBase& input_mesh, double length_multiplier = 1.0,
|
||||
const std::set<libMesh::subdomain_id_type>& block_ids =
|
||||
std::set<libMesh::subdomain_id_type>());
|
||||
|
||||
// Overridden methods
|
||||
int n_bins() const override;
|
||||
|
|
@ -1056,6 +1060,8 @@ public:
|
|||
|
||||
void write(const std::string& filename) const override;
|
||||
|
||||
int get_bin(Position r) const override;
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
int get_bin_from_element(const libMesh::Elem* elem) const override;
|
||||
|
|
@ -1064,6 +1070,9 @@ protected:
|
|||
|
||||
private:
|
||||
// Data members
|
||||
const std::set<libMesh::subdomain_id_type>
|
||||
block_ids_; //!< subdomains of the mesh to tally on
|
||||
const bool block_restrict_; //!< whether a subset of the mesh is being used
|
||||
const libMesh::dof_id_type num_active_; //!< cached number of active elements
|
||||
|
||||
std::vector<libMesh::dof_id_type>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue