-
Notifications
You must be signed in to change notification settings - Fork 66
Add support for EGADS geometry system #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 67 commits
0232dae
9ffeda7
4678b2d
dd0c9bd
a71b5c3
4698365
494b48c
56de2bd
4d11165
749572f
542eb7f
13c02dc
25ffd58
79a1869
432bea2
f7f35a2
e56f39d
83bab38
c7f8a65
c6cdfc6
4619442
e77a4ef
dbe89db
f474a5b
6e64cda
dc51601
761f5e5
67b60e9
dc71643
8964abe
640d67b
faf8e46
24dab6d
2576981
7437a90
2f07637
dd95ea8
c733e03
eae7fd6
572326e
5e2ef43
383e168
843e549
23de3fc
54d6a06
114273a
a55157a
420a015
7bbb112
7571748
a4e7219
edef983
b63e7e5
cb96614
e317b7e
4664d05
f5b9220
38f65e1
7c43f81
38b539f
cf181ef
c51a0fa
e14c8fe
bdaf4ca
7d5d26e
f3c0892
1832ccc
46f75a8
9a47057
a7e41e3
ad8ab1f
bf4420b
31a02f5
2e505f6
6bfd4c6
a4a41ef
2e1012d
0f8ea73
3ae5571
3fa7bc7
64e1dec
9aff5b6
b6f2b42
4f58438
f145720
f98fe6d
83e59a5
407ead5
afb21d5
910b12a
3f13376
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| #include <pcu_util.h> | ||
| #include <lionPrint.h> | ||
| #include <algorithm> | ||
| #include <iostream> | ||
|
|
||
| namespace apf { | ||
|
|
||
|
|
@@ -196,6 +197,16 @@ void Mesh::getParamOn(ModelEntity* g, MeshEntity* e, Vector3& p) | |
| ModelEntity* from_g = toModel(e); | ||
| if (g == from_g) | ||
| return getParam(e, p); | ||
|
|
||
| // above comparison only compares pointer address, this check's the entity's | ||
| // dim and tag in case it's the same entity but a different point to it | ||
| int from_dim = getModelType(from_g); | ||
| int from_tag = getModelTag(from_g); | ||
| int to_dim = getModelType(g); | ||
| int to_tag = getModelTag(g); | ||
| if ((from_dim == to_dim) && (from_tag == to_tag)) | ||
| return getParam(e, p); | ||
|
|
||
| gmi_ent* from = (gmi_ent*)from_g; | ||
| gmi_ent* to = (gmi_ent*)g; | ||
| Vector3 from_p; | ||
|
|
@@ -242,18 +253,15 @@ bool Mesh::isParamPointInsideModel(ModelEntity* g, | |
| gmi_free_set(adjRegions); | ||
| return true; | ||
| } | ||
| // for faces with more than 1 adj model region return true for now | ||
| // TODO: update for future | ||
| if (adjRegions->n == 2) { | ||
| gmi_free_set(adjRegions); | ||
| return true; | ||
| } | ||
| (void)param; | ||
| (void)x; | ||
| return true; /* | ||
| PCU_ALWAYS_ASSERT(adjRegions->n <= 1); | ||
| gmi_ent* r = (gmi_ent*)adjRegions->e[0]; | ||
| gmi_eval(getModel(), (gmi_ent*)g, ¶m[0], &x[0]); | ||
| int res = gmi_is_point_in_region(getModel(), r, &x[0]); | ||
| gmi_free_set(adjRegions); | ||
| return (res == 1) ? true : false; | ||
| return (res == 1) ? true : false; */ | ||
|
||
| } | ||
|
|
||
| bool Mesh::isInClosureOf(ModelEntity* g, ModelEntity* target){ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # - Try to find EGADS | ||
| # Once done this will define | ||
| # EGADS_FOUND - System has EGADS | ||
| # EGADS_INCLUDE_DIRS - The EGADS include directories | ||
| # EGADS_LIBRARIES - The libraries needed to use EGADS | ||
| # EGADS_DEFINITIONS - Compiler switches required for using EGADS | ||
|
|
||
| #set(EGADS_PREFIX "${EGADS_PREFIX_DEFAULT}" CACHE STRING "EGADS install directory") | ||
| #if(EGADS_PREFIX) | ||
| # message(STATUS "EGADS_PREFIX: ${EGADS_PREFIX}") | ||
| #endif() | ||
|
|
||
| find_path(EGADS_INCLUDE_DIR egads.h PATHS "${EGADS_DIR}/include") | ||
|
|
||
| option(EGADS_LITE "Use EGADS_LITE" OFF) | ||
| if (EGADS_LITE) | ||
| message(STATUS "Using EGADSlite") | ||
| find_library(EGADS_LIBRARY NAMES egadslite PATHS "${EGADS_DIR}/lib") | ||
| else() | ||
| message(STATUS "Using EGADS") | ||
| find_library(EGADS_LIBRARY NAMES egads libegads.so libegads.dylib PATHS "${EGADS_DIR}/lib") | ||
| endif() | ||
|
|
||
| set(EGADS_LIBRARIES ${EGADS_LIBRARY} ) | ||
| set(EGADS_INCLUDE_DIRS ${EGADS_INCLUDE_DIR} ) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| # handle the QUIETLY and REQUIRED arguments and set EGADS_FOUND to TRUE | ||
| # if all listed variables are TRUE | ||
| message(STATUS "beep boop: ${EGADS_LIBRARY}") | ||
| find_package_handle_standard_args( | ||
| EGADS | ||
| DEFAULT_MSG | ||
| EGADS_LIBRARY EGADS_INCLUDE_DIR | ||
| ) | ||
|
|
||
| mark_as_advanced(EGADS_INCLUDE_DIR EGADS_LIBRARY) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| if(DEFINED TRIBITS_PACKAGE) | ||
| include(pkg_tribits.cmake) | ||
| return() | ||
| endif() | ||
|
|
||
| if(NOT ENABLE_EGADS) | ||
| return() | ||
| endif() | ||
|
|
||
| option(EGADS_LITE "Enable EGADSlite" OFF) | ||
| # this file brings EGADS_LITE from CMake to C++ | ||
| configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmi_egads_config.h.in" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/gmi_egads_config.h") | ||
|
|
||
| #Sources & Headers | ||
| set(SOURCES gmi_egads.c) | ||
| set(HEADERS gmi_egads.h) | ||
|
|
||
| add_library(gmi_egads ${SOURCES}) | ||
|
|
||
| target_include_directories(gmi_egads PUBLIC ${EGADS_INCLUDE_DIR}) | ||
|
||
| target_link_libraries(gmi_egads PUBLIC gmi pcu ${EGADS_LIBRARIES}) | ||
|
|
||
| # Include directories | ||
| target_include_directories(gmi_egads PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
| $<INSTALL_INTERFACE:include> | ||
| ) | ||
| # make sure the compiler can find the config header | ||
| target_include_directories(gmi_egads PRIVATE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) | ||
|
|
||
| scorec_export_library(gmi_egads) | ||
|
|
||
| bob_end_subdir() | ||
Uh oh!
There was an error while loading. Please reload this page.