mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Getting infrastrucure setup for loading a CAD model and creating cell instances.
This commit is contained in:
parent
45ccb2da16
commit
0e0bb25591
5 changed files with 51 additions and 10 deletions
|
|
@ -311,6 +311,7 @@ add_library(libopenmc SHARED
|
|||
src/algorithm.F90
|
||||
src/bank_header.F90
|
||||
src/api.F90
|
||||
src/cad_header.F90
|
||||
src/cmfd_data.F90
|
||||
src/cmfd_execute.F90
|
||||
src/cmfd_header.F90
|
||||
|
|
|
|||
|
|
@ -150,10 +150,11 @@ protected:
|
|||
bool contains_complex(Position r, Direction u, int32_t on_surface) const;
|
||||
};
|
||||
|
||||
class CADCell : public Cell
|
||||
class CADCell : public Cell
|
||||
{
|
||||
moab::DagMC *dagmc_ptr;
|
||||
|
||||
|
||||
public:
|
||||
explicit CADCell();
|
||||
|
||||
};
|
||||
|
|
|
|||
29
src/cad.cpp
29
src/cad.cpp
|
|
@ -1,16 +1,31 @@
|
|||
|
||||
#include "cad.h"
|
||||
|
||||
extern moab::DagMC* DAGMC;
|
||||
|
||||
namespace moab {
|
||||
|
||||
void load_cad_geometry_c()
|
||||
{
|
||||
if(!DAGMC) {
|
||||
DAGMC = new DagMC();
|
||||
}
|
||||
|
||||
ErrorCode rval = DAGMC->load_file("dagmc.h5m");
|
||||
MB_CHK_ERR_CONT(rval);
|
||||
|
||||
rval = DAGMC->init_OBBTree();
|
||||
MB_CHK_ERR_CONT(rval);
|
||||
|
||||
// initialize cell objects
|
||||
for(int i = 0; i < DAGMC->num_entities(3); i++){
|
||||
|
||||
// set cell ids using global IDs
|
||||
openmc::CADCell c = openmc::CADCell();
|
||||
c.id = DAGMC->id_by_index(3, 0);
|
||||
openmc::cells_c.push_back(c);
|
||||
}
|
||||
|
||||
DagMC* DAGMC;
|
||||
|
||||
void load_geometry() {
|
||||
if(!DAGMC) { DAGMC = new DagMC(); }
|
||||
|
||||
ErrorCode rval;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
#ifndef CAD_H
|
||||
#define CAD_H
|
||||
|
||||
#include "DagMC.hpp"
|
||||
#include "cell.h"
|
||||
|
||||
extern "C" void load_cad_geometry_c();
|
||||
|
||||
#endif // CAD_H
|
||||
|
|
|
|||
19
src/cad_header.F90
Normal file
19
src/cad_header.F90
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module cad_header
|
||||
|
||||
use, intrinsic :: ISO_C_BINDING
|
||||
use hdf5
|
||||
|
||||
implicit none
|
||||
|
||||
interface
|
||||
subroutine load_cad_geometry_c() bind(C)
|
||||
end subroutine load_cad_geometry_c
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine load_cad_geometry()
|
||||
call load_cad_geometry_c()
|
||||
end subroutine load_cad_geometry
|
||||
|
||||
end module cad_header
|
||||
Loading…
Add table
Add a link
Reference in a new issue