Skip to content

Commit

Permalink
support simmodsuite 2023.1-231028
Browse files Browse the repository at this point in the history
  • Loading branch information
cwsmith committed Nov 10, 2023
1 parent b34ea58 commit fabcd53
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cmake/FindSimModSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ string(REGEX REPLACE
"${SIM_VERSION}")

set(MIN_VALID_SIM_VERSION 16.0.210606)
set(MAX_VALID_SIM_VERSION 17.0.220403)
set(MAX_VALID_SIM_VERSION 2023.1-231028)
if( ${SKIP_SIMMETRIX_VERSION_CHECK} )
message(STATUS "Skipping Simmetrix SimModSuite version check."
" This may result in undefined behavior")
Expand Down Expand Up @@ -113,7 +113,7 @@ message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}")
option(SIM_PARASOLID "Use Parasolid through Simmetrix" OFF)
if (SIM_PARASOLID)
set(MIN_SIM_PARASOLID_VERSION 290)
set(MAX_SIM_PARASOLID_VERSION 330)
set(MAX_SIM_PARASOLID_VERSION 360)
foreach(version RANGE
${MAX_SIM_PARASOLID_VERSION}
${MIN_SIM_PARASOLID_VERSION} -10)
Expand Down
52 changes: 30 additions & 22 deletions src/mixed_writeMesh.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#include "MeshSim.h"
#include "SimDiscrete.h"
#include "SimMessages.h"
#include "SimError.h"
#include "SimErrorCodes.h"
#include "SimMeshingErrorCodes.h"
#include "SimDiscreteErrorCodes.h"
#include <iostream>
using namespace std;

#include "Omega_h_comm.hpp"
#include "Omega_h_mesh.hpp"
#include "Omega_h_file.hpp"
#include "Omega_h_simConfig.h"
using namespace Omega_h;

#if SIMMODSUITE_MAJOR_VERSION >= 18 && SIMMODSUITE_MINOR_VERSION >= 220930
#include "SimInfo.h"
#include "SimInfoCodes.h"
#define SIM_ERROR(suffix,err) SimInfo_##suffix(err)
typedef pSimInfo pSimError;
#else
#include "SimError.h"
#include "SimErrorCodes.h"
#define SIM_ERROR(suffix,err) SimError_##suffix(err)
#endif

void messageHandler(int type, const char *msg)
{
switch (type) {
Expand Down Expand Up @@ -104,9 +112,9 @@ void hex_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down Expand Up @@ -134,9 +142,9 @@ void wedge_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down Expand Up @@ -164,9 +172,9 @@ void pyramid_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down Expand Up @@ -195,9 +203,9 @@ void tetOnWedge_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down Expand Up @@ -229,9 +237,9 @@ void pymOnHex_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down Expand Up @@ -266,9 +274,9 @@ void allType_gen(CommPtr comm, std::string const mesh_dir) {
vReturn, eReturn, mesh_path.c_str(), model_path.c_str());
} catch (pSimError err) {
cerr<<"SimModSuite error caught:"<<endl;
cerr<<" Error code: "<<SimError_code(err)<<endl;
cerr<<" Error string: "<<SimError_toString(err)<<endl;
SimError_delete(err);
cerr<<" Error code: "<<SIM_ERROR(code,err)<<endl;
cerr<<" Error string: "<<SIM_ERROR(toString,err)<<endl;
SIM_ERROR(delete,err);
} catch (...) {
cerr<<"Unhandled exception caught"<<endl;
}
Expand Down

0 comments on commit fabcd53

Please sign in to comment.