Skip to content

Commit 65c33fe

Browse files
authored
Merge pull request #966 from svalinn/v3.2.4-rc1
Merge v3.2.4 release candidate for final release
2 parents c1d8da1 + 94f5cac commit 65c33fe

File tree

9 files changed

+171
-91
lines changed

9 files changed

+171
-91
lines changed

.github/workflows/windows_build_test.yml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ name: Windows Build/Test
33
on:
44
# allows us to run workflows manually
55
workflow_dispatch:
6-
pull_request:
7-
branches:
8-
- develop
9-
paths-ignore:
10-
- '.github/workflows/docker_publish.yml'
11-
- '.github/workflows/linux_build_test.yml'
12-
- '.github/workflows/linux_upstream_test_*'
13-
- '.github/workflows/mac_build_test.yml'
14-
- '.github/workflows/housekeeping.yml'
15-
- '.github/workflows/changelog_test.yml'
16-
- '.github/actions/**'
17-
- 'CI/**'
18-
- 'doc/**'
6+
# pull_request:
7+
# branches:
8+
# - develop
9+
# paths-ignore:
10+
# - '.github/workflows/docker_publish.yml'
11+
# - '.github/workflows/linux_build_test.yml'
12+
# - '.github/workflows/linux_upstream_test_*'
13+
# - '.github/workflows/mac_build_test.yml'
14+
# - '.github/workflows/housekeeping.yml'
15+
# - '.github/workflows/changelog_test.yml'
16+
# - '.github/actions/**'
17+
# - 'CI/**'
18+
# - 'doc/**'
1919

20-
push:
21-
branches:
22-
- develop
23-
paths-ignore:
24-
- '.github/workflows/docker_publish.yml'
25-
- '.github/workflows/linux_build_test.yml'
26-
- '.github/workflows/linux_upstream_test_*'
27-
- '.github/workflows/mac_build_test.yml'
28-
- '.github/workflows/housekeeping.yml'
29-
- '.github/workflows/changelog_test.yml'
30-
- '.github/actions/**'
31-
- 'CI/**'
32-
- 'doc/**'
20+
# push:
21+
# branches:
22+
# - develop
23+
# paths-ignore:
24+
# - '.github/workflows/docker_publish.yml'
25+
# - '.github/workflows/linux_build_test.yml'
26+
# - '.github/workflows/linux_upstream_test_*'
27+
# - '.github/workflows/mac_build_test.yml'
28+
# - '.github/workflows/housekeeping.yml'
29+
# - '.github/workflows/changelog_test.yml'
30+
# - '.github/actions/**'
31+
# - 'CI/**'
32+
# - 'doc/**'
3333

3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -41,16 +41,16 @@ jobs:
4141

4242
- uses: conda-incubator/setup-miniconda@v3
4343
with:
44-
auto-activate-base: true
44+
auto-update-conda: true
45+
auto-activate-base: false
4546
activate-environment: ""
4647

4748
# yaml-cpp package has conflicting gtest headers and is not needed for this project
4849
- name: Conda dependencies
4950
shell: bash -l {0}
5051
run: |
5152
conda install curl eigen
52-
conda install -c conda-forge hdf5=1.10.6
53-
conda remove -y yaml-cpp
53+
conda install -c conda-forge hdf5==1.10.6
5454
5555
- name: Environment Variables
5656
shell: bash -l {0}
@@ -114,12 +114,15 @@ jobs:
114114
-DMOAB_DIR=../install_dir \
115115
-DHDF5_ROOT="${CONDA_LOC}" \
116116
-DHDF5_hdf5_LIBRARY_RELEASE="${CONDA_LOC}/lib/libhdf5_hl.lib;${CONDA_LOC}/lib/libhdf5.lib;${CONDA_LOC}/lib/zlib.lib;${CONDA_LOC}/lib/libhdf5_cpp.lib" \
117-
-DCMAKE_INSTALL_PREFIX=../install_dir/ \
118-
-DCMAKE_EXE_LINKER_FLAGS="" \
119-
-DCMAKE_MODULE_LINKER_FLAGS="" \
120-
-DCMAKE_SHARED_LINKER_FLAGS="" \
117+
-DCMAKE_EXE_LINKER_FLAGS="/std:c++latest -DH5_BUILT_AS_DYNAMIC_LIB" \
118+
-DCMAKE_MODULE_LINKER_FLAGS="/std:c++latest" \
119+
-DCMAKE_SHARED_LINKER_FLAGS="/std:c++latest" \
121120
-DCMAKE_STATIC_LINKER_FLAGS="" \
122-
-DCMAKE_BUILD_TYPE=Release
121+
-DCMAKE_EXE_LINKER_FLAGS="" \
122+
-DCMAKE_INSTALL_PREFIX=../install_dir/ \
123+
-DCMAKE_BUILD_TYPE=Release \
124+
-DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" \
125+
-DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe"
123126
cmake --build . --config Release
124127
cmake --install . --config Release
125128

CMakeLists.txt

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
project(DAGMC)
2-
cmake_minimum_required(VERSION 3.1)
2+
cmake_minimum_required(VERSION 3.18)
33
enable_language(CXX)
44

55
# Set DAGMC version
66
set(DAGMC_MAJOR_VERSION 3)
77
set(DAGMC_MINOR_VERSION 2)
8-
set(DAGMC_PATCH_VERSION 3)
8+
set(DAGMC_PATCH_VERSION 4)
99
set(DAGMC_VERSION ${DAGMC_MAJOR_VERSION}.${DAGMC_MINOR_VERSION}.${DAGMC_PATCH_VERSION})
1010

1111
if(MSVC)
1212
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
13+
add_definitions( -DH5_BUILT_AS_DYNAMIC_LIB )
1314
endif()
1415

1516

@@ -29,22 +30,6 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
2930
endif()
3031

3132
option(GIT_SUBMODULE "Check submodules during build" ON)
32-
if(GIT_SUBMODULE)
33-
message(STATUS "Submodule update")
34-
execute_process(COMMAND ${GIT_EXECUTABLE} "submodule" "update" "--init" "--recursive"
35-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
36-
RESULT_VARIABLE GIT_SUBMOD_RESULT)
37-
if(NOT GIT_SUBMOD_RESULT EQUAL 0)
38-
message(FATAL_ERROR "git submodule update --init --recursive failed with \
39-
${GIT_SUBMOD_RESULT}, please checkout submodules")
40-
endif()
41-
endif()
42-
endif()
43-
44-
# Check to see if submodules exist (by checking one)
45-
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/pyne/pyne/readme.rst")
46-
message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \
47-
turned off or failed. Please update submodules and try again.")
4833
endif()
4934

5035
# Make the scripts in the "cmake" directory available to CMake

doc/CHANGELOG.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ DAGMC Changelog
77
Next version
88
====================
99

10+
v3.2.4
11+
====================
12+
1013
**Changed:**
1114

1215
* Adding info messages to CMake output for double down (#962)
13-
* Update hdf5 to v1.14.3 from v1.10.4 (#931 #933)
16+
* Update hdf5 to v1.14.3 from v1.10.4 for linux builds (#931 #933)
1417
* Ensure implicit complement handle is placed at the back of DAGMC volume indices (#935)
1518
* Update MOAB to 5.5.1 from 5.3.0 (#939 #940)
1619
* Update README regarding OpenMC (#938)
@@ -21,6 +24,9 @@ Next version
2124
* Update github actions to newer versions as necessary (#958)
2225
* CMake error message update (#960)
2326
* Updated documentation to build dependencies (#963)
27+
* Pause support for Windows (#966)
28+
* Localize invocation of git submodule for PyNE (#968)
29+
* Fixed the name of the Graveyard and the Vaccuum to mat:Graveyard and mat:Vacuum (and lower case) (#971)
2430

2531
v3.2.3
2632
====================

src/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ if (BUILD_MCNP5 OR BUILD_MCNP6 OR BUILD_GEANT4 OR BUILD_FLUKA OR BUILD_CI_TESTS)
1515
endif ()
1616
if (BUILD_UWUW)
1717
add_subdirectory(uwuw)
18+
19+
if(GIT_SUBMODULE)
20+
message(STATUS "Submodule update")
21+
execute_process(COMMAND ${GIT_EXECUTABLE} "submodule" "update" "--init" "--recursive"
22+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
23+
RESULT_VARIABLE GIT_SUBMOD_RESULT)
24+
if(NOT GIT_SUBMOD_RESULT EQUAL 0)
25+
message(FATAL_ERROR "git submodule update --init --recursive failed with \
26+
${GIT_SUBMOD_RESULT}, please checkout submodules")
27+
endif()
28+
endif()
29+
30+
# Check to see if submodules exist (by checking one)
31+
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/pyne/pyne/readme.rst")
32+
message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \
33+
turned off or failed. Please update submodules and try again.")
34+
endif()
1835
add_subdirectory(pyne)
1936
endif ()
2037

src/dagmc/dagmcmetadata.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -209,32 +209,30 @@ void dagmcMetaData::parse_material_data() {
209209

210210
// set the material value
211211
volume_material_property_data_eh[eh] = grp_name;
212-
213-
bool is_graveyard =
214-
to_lower(grp_name).find(to_lower(graveyard_str)) != std::string::npos;
215-
bool is_vacuum =
216-
to_lower(grp_name).find(to_lower(vacuum_str)) != std::string::npos;
212+
logger.message("Group name -- " + grp_name);
213+
bool is_graveyard = (to_lower(grp_name) == to_lower(graveyard_mat_str()));
214+
bool is_vacuum = (to_lower(grp_name) == to_lower(vacuum_mat_str()));
217215

218216
// not graveyard or vacuum or implicit compliment
219217
if (!is_graveyard && !is_vacuum && !DAG->is_implicit_complement(eh)) {
220218
volume_material_data_eh[eh] = material_props[0];
221219
}
222220
// found graveyard
223221
else if (is_graveyard) {
224-
volume_material_property_data_eh[eh] = "mat:Graveyard";
225-
volume_material_data_eh[eh] = graveyard_str;
222+
volume_material_property_data_eh[eh] = graveyard_mat_str();
223+
volume_material_data_eh[eh] = graveyard_str();
226224
}
227225
// vacuum
228226
else if (is_vacuum) {
229-
volume_material_property_data_eh[eh] = "mat:Vacuum";
230-
volume_material_data_eh[eh] = vacuum_str;
227+
volume_material_property_data_eh[eh] = vacuum_mat_str();
228+
volume_material_data_eh[eh] = vacuum_str();
231229
}
232230
// implicit complement
233231
else if (DAG->is_implicit_complement(eh)) {
234232
if (implicit_complement_material == "") {
235233
logger.message("Implicit Complement assumed to be Vacuum");
236-
volume_material_property_data_eh[eh] = "mat:Vacuum";
237-
volume_material_data_eh[eh] = vacuum_str;
234+
volume_material_property_data_eh[eh] = vacuum_mat_str();
235+
volume_material_data_eh[eh] = vacuum_str();
238236
} else {
239237
volume_material_property_data_eh[eh] =
240238
"mat:" + implicit_complement_material;
@@ -379,18 +377,18 @@ void dagmcMetaData::parse_boundary_data() {
379377
exit(EXIT_FAILURE);
380378
}
381379
// 2d entities have been tagged with the boundary condition property
382-
// ie. both surfaces and its members triangles,
380+
// ie. both surfaces and its member triangles
383381

384382
std::string bc_string = to_lower(boundary_assignment[0]);
385383

386-
if (bc_string.find(to_lower(reflecting_str)) != std::string::npos)
387-
surface_boundary_data_eh[eh] = reflecting_str;
388-
if (bc_string.find(to_lower(white_str)) != std::string::npos)
389-
surface_boundary_data_eh[eh] = white_str;
390-
if (bc_string.find(to_lower(periodic_str)) != std::string::npos)
391-
surface_boundary_data_eh[eh] = periodic_str;
392-
if (bc_string.find(to_lower(vacuum_str)) != std::string::npos)
393-
surface_boundary_data_eh[eh] = vacuum_str;
384+
if (bc_string.find(to_lower(reflecting_str())) != std::string::npos)
385+
surface_boundary_data_eh[eh] = reflecting_str();
386+
if (bc_string.find(to_lower(white_str())) != std::string::npos)
387+
surface_boundary_data_eh[eh] = white_str();
388+
if (bc_string.find(to_lower(periodic_str())) != std::string::npos)
389+
surface_boundary_data_eh[eh] = periodic_str();
390+
if (bc_string.find(to_lower(vacuum_str())) != std::string::npos)
391+
surface_boundary_data_eh[eh] = vacuum_str();
394392
}
395393
}
396394

src/dagmc/dagmcmetadata.hpp

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,21 @@ class dagmcMetaData {
316316
*/
317317
std::map<moab::EntityHandle, std::map<std::string, double>> importance_map;
318318

319+
// Getting some constant keyword values
320+
const std::string& graveyard_str() const { return graveyard_str_; }
321+
const std::string& vacuum_str() const { return vacuum_str_; }
322+
const std::string& vacuum_mat_str() const { return vacuum_mat_str_; }
323+
const std::string& graveyard_mat_str() const { return graveyard_mat_str_; }
324+
const std::string& reflecting_str() const { return reflecting_str_; }
325+
const std::string& white_str() const { return white_str_; }
326+
const std::string& periodic_str() const { return periodic_str_; }
327+
328+
// Allowing modify some constant keyword values
329+
void set_graveyard_str(std::string val) { graveyard_str_ = val; }
330+
void set_vacuum_str(std::string val) { vacuum_str_ = val; }
331+
void set_vacuum_mat_str(std::string val) { vacuum_mat_str_ = val; }
332+
void set_graveyard_mat_str(std::string val) { graveyard_mat_str_ = val; }
333+
319334
// private member variables
320335
private:
321336
/**
@@ -351,11 +366,14 @@ class dagmcMetaData {
351366
std::map<std::string, std::string> keyword_synonyms;
352367

353368
// Some constant keyword values
354-
const std::string graveyard_str{"Graveyard"};
355-
const std::string vacuum_str{"Vacuum"};
356-
const std::string reflecting_str{"Reflecting"};
357-
const std::string white_str{"White"};
358-
const std::string periodic_str{"Periodic"};
369+
const std::string reflecting_str_{"Reflecting"};
370+
const std::string white_str_{"White"};
371+
const std::string periodic_str_{"Periodic"};
372+
// Some less constant keyword values
373+
std::string graveyard_str_{"Graveyard"};
374+
std::string vacuum_str_{"Vacuum"};
375+
std::string vacuum_mat_str_{"mat:Vacuum"};
376+
std::string graveyard_mat_str_{"mat:Graveyard"};
359377

360378
DagMC_Logger logger;
361379
};

src/dagmc/tests/dagmc_unit_tests.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,63 @@ TEST_F(DagmcMetadataTest, TestMatAssigns) {
8181
}
8282
}
8383
//---------------------------------------------------------------------------//
84+
// FIXTURE-BASED TESTS: Tests to make sure that vacuum detection is done
85+
// properly
86+
//---------------------------------------------------------------------------//
87+
TEST_F(DagmcMetadataTest, TestVacuumName) {
88+
// Test default behavior for vacuum name
89+
{
90+
// new metadata instance
91+
dgm = std::make_shared<dagmcMetaData>(DAG.get());
92+
// process
93+
dgm->load_property_data();
94+
95+
int num_vol = DAG->num_entities(3);
96+
std::vector<int> vol_ids = {1, 2, 3, 4};
97+
98+
std::vector<std::string> vacuum_names = {"Hydrogen", "Hydrogen", "Hydrogen",
99+
"Vacuum"};
100+
for (int id : vol_ids) {
101+
std::string mat_prop = dgm->get_volume_property("material", id, false);
102+
EXPECT_EQ(mat_prop, vacuum_names[id - 1]);
103+
}
104+
}
105+
106+
// Changing the vacuum name to detect mat:Hydrogen as the vacuum
107+
{
108+
dgm = std::make_shared<dagmcMetaData>(DAG.get());
109+
110+
dgm->set_vacuum_mat_str("mat:Hydrogen");
111+
dgm->load_property_data();
112+
int num_vol = DAG->num_entities(3);
113+
std::vector<int> vol_ids = {1, 2, 3, 4};
114+
115+
std::vector<std::string> vacuum_names = {"Vacuum", "Vacuum", "Vacuum",
116+
"Vacuum"};
117+
for (int id : vol_ids) {
118+
std::string mat_prop = dgm->get_volume_property("material", id, false);
119+
EXPECT_EQ(mat_prop, vacuum_names[id - 1]);
120+
}
121+
}
122+
123+
// Ensuring that partial name overlap don't affect vacuum detection
124+
{
125+
dgm = std::make_shared<dagmcMetaData>(DAG.get());
126+
127+
dgm->set_vacuum_mat_str("Hydro");
128+
dgm->load_property_data();
129+
int num_vol = DAG->num_entities(3);
130+
std::vector<int> vol_ids = {1, 2, 3, 4};
131+
132+
std::vector<std::string> vacuum_names = {"Hydrogen", "Hydrogen", "Hydrogen",
133+
"Vacuum"};
134+
for (int id : vol_ids) {
135+
std::string mat_prop = dgm->get_volume_property("material", id, false);
136+
EXPECT_EQ(mat_prop, vacuum_names[id - 1]);
137+
}
138+
}
139+
}
140+
//---------------------------------------------------------------------------//
84141
// FIXTURE-BASED TESTS: Tests to make sure that all densities have successfully
85142
// been assigned and successfully retreved from the metadata class
86143
// in this test there was no density data assigned, so it should be ""

0 commit comments

Comments
 (0)