Skip to content

Commit

Permalink
use apf_simConfig.h to access sim version
Browse files Browse the repository at this point in the history
Installing apf_simConfig.h as it is used in tests and could be helpful for others.  I can't think of a good reason not to install it.
  • Loading branch information
cwsmith committed Mar 5, 2024
1 parent f37053e commit 9f4e908
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
28 changes: 16 additions & 12 deletions apf_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ if(NOT ENABLE_SIMMETRIX)
return()
endif()

option(ENABLE_FIELDSIM "Enable use of FieldSim from Simmetrix SimModSuite" FALSE)
message(STATUS "ENABLE_FIELDSIM: ${ENABLE_FIELDSIM}")
set(USE_FIELDSIM FALSE)
if( ${SIMMODSUITE_SimField_FOUND} AND ENABLE_FIELDSIM )
set(USE_FIELDSIM TRUE)
endif()
set(USE_SIM_ADVMESHING ${HAVE_SIMADVMESHING})

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/apf_simConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h
DESTINATION include)

#Sources & Headers
set(SOURCES apfSIM.cc)
set(HEADERS apfSIM.h)
Expand All @@ -21,21 +35,11 @@ target_include_directories(apf_sim PUBLIC
$<INSTALL_INTERFACE:include>
)

option(ENABLE_FIELDSIM "Enable use of FieldSim from Simmetrix SimModSuite" FALSE)
message(STATUS "ENABLE_FIELDSIM: ${ENABLE_FIELDSIM}")
set(USE_FIELDSIM FALSE)
if( ${SIMMODSUITE_SimField_FOUND} AND ENABLE_FIELDSIM )
set(USE_FIELDSIM TRUE)
endif()
set(USE_SIM_ADVMESHING ${HAVE_SIMADVMESHING})

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/apf_simConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/apf_simConfig.h")
#directory containing apf_simConfig.h
target_include_directories(apf_sim PRIVATE
target_include_directories(apf_sim PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)


scorec_export_library(apf_sim)

bob_end_subdir()
2 changes: 1 addition & 1 deletion phasta/phAttrib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <SimModel.h>
#include <cstdlib>
#include <iostream>

#include "apf_simConfig.h"

typedef ph::BC* (*BCFactory)(pAttribute a, pGEntity ge);
typedef std::map<std::string, BCFactory> BCFactories;
Expand Down
1 change: 0 additions & 1 deletion phasta/phMeshQuality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <apfMatrix.h>
#include <maSize.h>
#include <maShape.h>
//#include "apf_simConfig.h"

#ifdef HAVE_SIMMETRIX
#include <SimUtil.h>
Expand Down
1 change: 1 addition & 0 deletions test/generate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <SimUtil.h>
#include <apfSIM.h>
#include <apfMDS.h>
#include <apf_simConfig.h>
#include "gmi_sim_config.h"
#include <gmi_sim.h>
#include <apf.h>
Expand Down
2 changes: 1 addition & 1 deletion test/rm_extrusion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <SimPartitionedMesh.h>
#include <SimUtil.h>
#include <apfSIM.h>
#include <../apf_sim/apf_simConfig.h>
#include <apf_simConfig.h>
#include <apfMDS.h>
#include <gmi.h>
#include <gmi_sim.h>
Expand Down
3 changes: 1 addition & 2 deletions test/simTranslate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include <stdlib.h>
#include <string>

/* hack to get SIMMODSUITE_MAJOR_VERSION and SIMMODSUITE_MINOR_VERSION */
#include "../apf_sim/apf_simConfig.h"
#include <apf_simConfig.h>
/* cheap hackish way to get SIM_PARASOLID and SIM_ACIS */
#include "gmi_sim_config.h"
#include <gmi_sim.h>
Expand Down

0 comments on commit 9f4e908

Please sign in to comment.