mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Using a DAGSurface/Cell class attribute to track DAGMC indices and contain +1's.
This commit is contained in:
parent
23fc873a69
commit
1df5e95f66
5 changed files with 14 additions and 9 deletions
|
|
@ -182,6 +182,7 @@ class DAGCell : public Cell
|
|||
public:
|
||||
moab::DagMC* dagmc_ptr_;
|
||||
DAGCell();
|
||||
int32_t dag_index_;
|
||||
|
||||
bool contains(Position r, Direction u, int32_t on_surface) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,8 @@ class DAGSurface : public Surface
|
|||
public:
|
||||
moab::DagMC* dagmc_ptr_;
|
||||
DAGSurface();
|
||||
int32_t dag_index_;
|
||||
|
||||
double evaluate(Position r) const;
|
||||
double distance(Position r, Direction u, bool coincident) const;
|
||||
Direction normal(Position r) const;
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ std::pair<double, int32_t>
|
|||
DAGCell::distance(Position r, Direction u, int32_t on_surface) const
|
||||
{
|
||||
moab::ErrorCode rval;
|
||||
moab::EntityHandle vol = dagmc_ptr_->entity_by_index(3, model::cell_map[id_] + 1);
|
||||
moab::EntityHandle vol = dagmc_ptr_->entity_by_index(3, dag_index_);
|
||||
moab::EntityHandle hit_surf;
|
||||
double dist;
|
||||
double pnt[3] = {r.x, r.y, r.z};
|
||||
|
|
@ -621,7 +621,7 @@ DAGCell::distance(Position r, Direction u, int32_t on_surface) const
|
|||
bool DAGCell::contains(Position r, Direction u, int32_t on_surface) const
|
||||
{
|
||||
moab::ErrorCode rval;
|
||||
moab::EntityHandle vol = dagmc_ptr_->entity_by_index(3, model::cell_map[id_] + 1);
|
||||
moab::EntityHandle vol = dagmc_ptr_->entity_by_index(3, dag_index_);
|
||||
|
||||
int result = 0;
|
||||
double pnt[3] = {r.x, r.y, r.z};
|
||||
|
|
@ -830,9 +830,9 @@ openmc_extend_cells(int32_t n, int32_t* index_start, int32_t* index_end)
|
|||
int32_t next_cell(DAGCell* cur_cell, DAGSurface* surf_xed)
|
||||
{
|
||||
moab::EntityHandle surf =
|
||||
surf_xed->dagmc_ptr_->entity_by_index(2, model::surface_map[surf_xed->id_] + 1);
|
||||
surf_xed->dagmc_ptr_->entity_by_index(2, surf_xed->dag_index_);
|
||||
moab::EntityHandle vol =
|
||||
cur_cell->dagmc_ptr_->entity_by_index(3, model::cell_map[cur_cell->id_] + 1);
|
||||
cur_cell->dagmc_ptr_->entity_by_index(3, cur_cell->dag_index_);
|
||||
|
||||
moab::EntityHandle new_vol;
|
||||
cur_cell->dagmc_ptr_->next_vol(surf, vol, new_vol);
|
||||
|
|
|
|||
|
|
@ -138,7 +138,8 @@ void load_dagmc_geometry()
|
|||
|
||||
// set cell ids using global IDs
|
||||
DAGCell* c = new DAGCell();
|
||||
c->id_ = model::DAG->id_by_index(3, i+1);
|
||||
c->dag_index_ = i+1;
|
||||
c->id_ = model::DAG->id_by_index(3, c->dag_index_);
|
||||
c->dagmc_ptr_ = model::DAG;
|
||||
c->universe_ = dagmc_univ_id; // set to zero for now
|
||||
c->fill_ = C_NONE; // no fill, single universe
|
||||
|
|
@ -261,7 +262,8 @@ void load_dagmc_geometry()
|
|||
|
||||
// set cell ids using global IDs
|
||||
DAGSurface* s = new DAGSurface();
|
||||
s->id_ = model::DAG->id_by_index(2, i+1);
|
||||
s->dag_index_ = i+1;
|
||||
s->id_ = model::DAG->id_by_index(2, s->dag_index_);
|
||||
s->dagmc_ptr_ = model::DAG;
|
||||
|
||||
// set BCs
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ double
|
|||
DAGSurface::distance(Position r, Direction u, bool coincident) const
|
||||
{
|
||||
moab::ErrorCode rval;
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_id(2, id_);
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_index(2, dag_index_);
|
||||
moab::EntityHandle hit_surf;
|
||||
double dist;
|
||||
double pnt[3] = {r.x, r.y, r.z};
|
||||
|
|
@ -256,7 +256,7 @@ Direction DAGSurface::normal(Position r) const
|
|||
{
|
||||
moab::ErrorCode rval;
|
||||
Direction u;
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_id(2, id_);
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_index(2, dag_index_);
|
||||
double pnt[3] = {r.x, r.y, r.z};
|
||||
double dir[3] = {u.x, u.y, u.z};
|
||||
rval = dagmc_ptr_->get_angle(surf, pnt, dir);
|
||||
|
|
@ -267,7 +267,7 @@ Direction DAGSurface::normal(Position r) const
|
|||
BoundingBox DAGSurface::bounding_box() const
|
||||
{
|
||||
moab::ErrorCode rval;
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_id(2, id_);
|
||||
moab::EntityHandle surf = dagmc_ptr_->entity_by_index(2, dag_index_);
|
||||
double min[3], max[3];
|
||||
rval = dagmc_ptr_->getobb(surf, min, max);
|
||||
MB_CHK_ERR_CONT(rval);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue