Skip to content
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
0232dae
Created barebones framework for EGADS model support. Need to look at …
tuckerbabcock Nov 13, 2019
9ffeda7
Added implementation of gmi_egads_load. Reqiuired adding methods to E…
tuckerbabcock Nov 13, 2019
4678b2d
re-implemented gmi_egads_load to use existing EGADS functions
tuckerbabcock Nov 14, 2019
dd0c9bd
more implementation of gmi functions.
tuckerbabcock Nov 14, 2019
a71b5c3
all methods have preliminary implementation. Now trying to link and c…
tuckerbabcock Nov 17, 2019
4698365
moved gmi_egads files to new gmi_egads directory
tuckerbabcock Nov 17, 2019
494b48c
Added cmake files for finding and compiling with EGADS. Currently the…
tuckerbabcock Nov 17, 2019
56de2bd
fix some typos causing compile erros
tuckerbabcock Nov 19, 2019
4d11165
gmi-egads builds without any erros now
tuckerbabcock Nov 19, 2019
749572f
gmi_egads compiles and links, though mesh verify fails.
tuckerbabcock Nov 20, 2019
542eb7f
testing fails with 3D and 2D meshes.For 2D at least it seems the AFLR…
tuckerbabcock Nov 23, 2019
13c02dc
added 2D ugrid support
tuckerbabcock Dec 13, 2019
25ffd58
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Dec 13, 2019
79a1869
read dummy face ID
tuckerbabcock Dec 13, 2019
432bea2
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Dec 13, 2019
f7f35a2
fix read amount for dummy face ID
tuckerbabcock Dec 13, 2019
e56f39d
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Dec 13, 2019
83bab38
changed to egads reader based on how memory was being managed. Needs …
tuckerbabcock Dec 16, 2019
c7f8a65
2D ugrid reader now reads a 2D ugrid mesh and can verify and write to…
tuckerbabcock Dec 16, 2019
c6cdfc6
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Dec 16, 2019
4619442
added algorithm include
tuckerbabcock Dec 16, 2019
e77a4ef
Merge branch 'ugrid1D-dev' into egads-dev
tuckerbabcock Dec 16, 2019
dbe89db
changed gmi_normal to use correct get topology
tuckerbabcock Dec 16, 2019
f474a5b
added print statements for debug
tuckerbabcock Dec 16, 2019
6e64cda
added function for vertex reparameterization on an edge
tuckerbabcock Dec 16, 2019
dc51601
added parameterization of vertices onto edges and faces in ugrid read…
tuckerbabcock Dec 18, 2019
761f5e5
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Dec 18, 2019
67b60e9
rewrote apf function loadMdsFromUgrid to read the header and figure o…
tuckerbabcock Jan 24, 2020
dc71643
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Jan 24, 2020
8964abe
cleaning up code prior to pull request
tuckerbabcock Jan 24, 2020
640d67b
removed static from gmi_egads_load
tuckerbabcock Jan 24, 2020
faf8e46
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Jan 24, 2020
24dab6d
curved 2D meshing works with EGADS with ugrid reading
tuckerbabcock Jan 25, 2020
2576981
removing old code
tuckerbabcock Jan 25, 2020
7437a90
removed print statements
tuckerbabcock Jan 25, 2020
2f07637
Merge branch 'ugrid2D-dev' into egads-dev
tuckerbabcock Jan 25, 2020
dd95ea8
added egads_ent struct that wraps ego, and attempts to support 3D mod…
tuckerbabcock Jan 26, 2020
c733e03
quick change to struct typedef so it will compile on scorec
tuckerbabcock Jan 26, 2020
eae7fd6
changing pointers and mallocs
tuckerbabcock Jan 27, 2020
572326e
Merge branch 'egads-dev' of github.com:tuckerbabcock/core into egads-dev
tuckerbabcock Jan 27, 2020
5e2ef43
more pointer/reference changes
tuckerbabcock Jan 27, 2020
383e168
changes from last night on scorec
tuckerbabcock Jan 27, 2020
843e549
merged changes
tuckerbabcock Jan 27, 2020
23de3fc
seem to have fixed strange malloc issue. Wasn't allocating room for t…
tuckerbabcock Jan 27, 2020
54d6a06
Added new method to initialize used in pumiAIM
tuckerbabcock Feb 5, 2020
114273a
changed FindEGADS file to make it work better.
tuckerbabcock Feb 5, 2020
a55157a
Merge branch 'egads-dev' of github.com:tuckerbabcock/core into egads-dev
tuckerbabcock Feb 5, 2020
420a015
re-wrote gmi_egads to use new global array of ents to handle allocati…
tuckerbabcock Feb 27, 2020
7bbb112
implemented getVertexUV
tuckerbabcock Feb 27, 2020
7571748
pumi verifies tetgen mesh with multiple regions
tuckerbabcock Feb 29, 2020
a4e7219
can read adjacency binary file from PUMI AIM
tuckerbabcock Mar 1, 2020
edef983
freeing adjacency table
tuckerbabcock Mar 1, 2020
b63e7e5
commenting out prints
tuckerbabcock Mar 18, 2020
cb96614
fix errors
tuckerbabcock Mar 18, 2020
e317b7e
temporarily making isParamPointInsideModel always return true to allo…
tuckerbabcock Mar 26, 2020
4664d05
cleaning up memory use more
tuckerbabcock Apr 24, 2020
f5b9220
merge upstream develop into egads-dev
tuckerbabcock Aug 10, 2020
38f65e1
merge updates
tuckerbabcock Aug 10, 2020
7c43f81
made everything not part of the interface static, moved non-public pa…
tuckerbabcock Sep 22, 2020
38b539f
fix compiler warnings related to fread on gcc 10
tuckerbabcock Oct 20, 2020
cf181ef
removing unneeded forward declaration of struct
tuckerbabcock Nov 5, 2020
c51a0fa
adding egads related things to the split executable, making egads_glo…
tuckerbabcock Nov 20, 2020
e14c8fe
Merge branch 'develop' into egads-dev
tuckerbabcock Feb 12, 2021
bdaf4ca
Merge branch 'egads-dev' of github.com:tuckerbabcock/core into egads-dev
tuckerbabcock Feb 12, 2021
7d5d26e
reverting example_config
tuckerbabcock Feb 12, 2021
f3c0892
address clang warning about firstFace being used uninitialized
tuckerbabcock Feb 12, 2021
1832ccc
attempting to add EGADS split tests
tuckerbabcock Feb 13, 2021
46f75a8
introduced new egads_model struct to store model specific things and …
tuckerbabcock Feb 15, 2021
9a47057
cleaning up old print statements
tuckerbabcock Feb 15, 2021
a7e41e3
document sup filename and free it
tuckerbabcock Feb 15, 2021
ad8ab1f
use private linkage and header file includes for EGADS headers and li…
tuckerbabcock Feb 16, 2021
bf4420b
revert changes from isParamPointInsideModel
tuckerbabcock Feb 16, 2021
31a02f5
remove iostream include from apfMesh.cc
tuckerbabcock Feb 16, 2021
2e505f6
using cmake's configure_file to define the locations of the egads and…
tuckerbabcock Mar 25, 2021
6bfd4c6
added function pointers and routines for opening/closing dylib
tuckerbabcock Mar 25, 2021
a4a41ef
function pointers loaded and switched to using them
tuckerbabcock Mar 25, 2021
2e1012d
switched to lazy symbol loading
tuckerbabcock Mar 25, 2021
0f8ea73
added error checking to make sure EGADS is loaded correctly
tuckerbabcock Mar 25, 2021
3ae5571
got rid of EG_isEquivalent since it does not work with EGADSlite
tuckerbabcock Mar 25, 2021
3fa7bc7
added egads stuff to verify executable
tuckerbabcock Mar 25, 2021
64e1dec
remove goto from getVertexUV
tuckerbabcock Mar 26, 2021
9aff5b6
make fail str buffers larger to address compile error on gcc 8.1.0
tuckerbabcock Mar 27, 2021
b6f2b42
switching to only using EGADSlite
tuckerbabcock Mar 29, 2021
4f58438
added back the option to build gmi_egads with EGADS or EGADSlite, opt…
tuckerbabcock Apr 2, 2021
f145720
change USE_EGADSLITE to PUMI_USE_EGADSLITE
tuckerbabcock Apr 2, 2021
f98fe6d
remove egadslite include accidentally commited
tuckerbabcock Apr 3, 2021
83e59a5
Merge branch 'master' into egads-dev
tuckerbabcock Feb 18, 2022
407ead5
Merge branch 'master' into egads-dev
tuckerbabcock Feb 18, 2022
afb21d5
update CMake support for finding EGADS, import it as a target now, an…
tuckerbabcock Jul 25, 2022
910b12a
Update gmi EGADS CMake setup to use target_compile_definitions for HA…
tuckerbabcock Aug 2, 2022
3f13376
enable testing EGADS with EGADSLITE enabled
tuckerbabcock Aug 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,16 @@ set(Trilinos_PREFIX "" CACHE STRING "Trilinos installation directory")
option(SKIP_SIMMETRIX_VERSION_CHECK "enable at your own risk; it may result in undefined behavior" OFF)
option(ENABLE_SIMMETRIX "Build with Simmetrix support" OFF)
message(STATUS "ENABLE_SIMMETRIX: ${ENABLE_SIMMETRIX}")
option(ENABLE_EGADS "Build with EGADS support" OFF)
message(STATUS "ENABLE_EGADS: ${ENABLE_EGADS}")
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")
if(ENABLE_SIMMETRIX)
add_definitions(-DHAVE_SIMMETRIX)
endif()
if(ENABLE_EGADS)
add_definitions(-DHAVE_EGADS)
endif()

option(ENABLE_FPP "Build with snapping to first problem plane" OFF)
message(STATUS "ENABLE_FPP: ${ENABLE_FPP}")
Expand All @@ -113,6 +118,10 @@ if(ENABLE_SIMMETRIX)
find_package(SimModSuite MODULE REQUIRED)
endif()

if(ENABLE_EGADS)
find_package(EGADS MODULE REQUIRED)
endif()

if(ENABLE_OMEGA_H)
# find the omega_h library
set(SCOREC_USE_Omega_h_DEFAULT ${ENABLE_OMEGA_H})
Expand All @@ -125,6 +134,7 @@ add_subdirectory(lion)
add_subdirectory(pcu)
add_subdirectory(gmi)
add_subdirectory(gmi_sim)
add_subdirectory(gmi_egads)
add_subdirectory(can)
add_subdirectory(mth)
add_subdirectory(apf)
Expand Down
22 changes: 15 additions & 7 deletions apf/apfMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <pcu_util.h>
#include <lionPrint.h>
#include <algorithm>
#include <iostream>

namespace apf {

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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, &param[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; */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you break this function? Do we not test this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were based on the discussion in #293 and I haven't looked at them since. It looks like @mortezah may have implemented something that at least partially addresses the issue, so my changes could probably be reverted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the exact functionality, so @mortezah might be able to shed more light. But, based on the discussion the solution of return true looks like a work around which needs to get fully fixed before merging?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tuckerbabcock the quick fix of returning true you put in place at the time we were discussing issue #293 is obsolete now. The code has changed since then and the current implementation of this function should work for you case, as well. If it did not, let me know.

@jacobmerson

Copy link
Contributor Author

@tuckerbabcock tuckerbabcock Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mortezah. I've reverted these changes in bf4420b.

}

bool Mesh::isInClosureOf(ModelEntity* g, ModelEntity* target){
Expand Down
1 change: 1 addition & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_OPTIONAL_PACKAGES
SCORECgmi_sim
SCORECapf_sim
SCORECgmi_egads
LIB_REQUIRED_PACKAGES
SCOREClion
SCORECpcu
Expand Down
37 changes: 37 additions & 0 deletions cmake/FindEGADS.cmake
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)
35 changes: 35 additions & 0 deletions gmi_egads/CMakeLists.txt
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})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursory look over indicates that egads isn't part of the interface, so you should be using PRIVATE linkage and header file includes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got no objections to switching to private linkage, but I want to make sure that some of the symbols are not internal. While they're not part of the public interface for PUMI (and thus not in the header file), I use struct gmi_model* gmi_egads_init(struct egObject *body, int numRegions) and void gmi_egads_init_adjacency(int ***adjacency) in the code that generates a mesh in the PUMI format from an EGADS model, so I need those functions to be callable from an external project. I don't think I know enough about cmake to make that happen, or if that is even what you're really referring to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EGADS_INCLUDE_DIR and EGADS_LIBRARIES point to the external egads libraries. If you are doing a public linkage/include you are requiring that the user of the compiled pumi library can also link against those libs. If you make the linkage private then you will need to have egads to compile pumi with egads support, but whoever consumes pumi will not need to have access to egads to compile/link. (although you will need the egads library at runtime if you do dynamic linkage)

Your functions gmi_egads_init and gmi_egads_init_adjacency are part of the gmi_egads library target that you create, and you want those visible to anyone who consumes your library, so adding the CMAKE_CURRENT_SOURCE_DIR and include as public targets is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I've addressed this in ad8ab1f.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 😃

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()
Loading