Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
gmsh
Commits
213e0dba
Commit
213e0dba
authored
Sep 13, 2018
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
simpler DLL definitions
parent
a93cf0f1
No related branches found
No related tags found
No related merge requests found
Pipeline
#2510
passed
Sep 13, 2018
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+9
-10
9 additions, 10 deletions
CMakeLists.txt
demos/api/crack.py
+41
-0
41 additions, 0 deletions
demos/api/crack.py
with
50 additions
and
10 deletions
CMakeLists.txt
+
9
−
10
View file @
213e0dba
...
...
@@ -274,12 +274,14 @@ if(MSVC)
set
(
${
VAR
}
"
${${
VAR
}}
/MP"
)
endif
(
NOT
${
VAR
}
MATCHES
"/MP"
)
endforeach
(
VAR
)
if
(
ENABLE_PRIVATE_API
)
if
(
ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED
)
# automatically export .def file with all symbols (requires CMake 3.4);
# depending on the compiling options this might lead to more than 64k export
# symbols; just trim the .def file to keep the ones you need
set
(
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE
)
endif
(
ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED
)
endif
(
ENABLE_PRIVATE_API
)
endif
(
MSVC
)
if
(
ENABLE_OPENMP
)
...
...
@@ -1520,16 +1522,13 @@ endif(ENABLE_BUILD_LIB)
# shared library target
if
(
ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC
)
if
(
WIN32 OR CYGWIN
)
add_definitions
(
-DGMSH_DLL
)
endif
(
WIN32 OR CYGWIN
)
add_library
(
shared SHARED
${
GMSH_SRC
}
)
set_target_properties
(
shared PROPERTIES OUTPUT_NAME gmsh
VERSION
${
GMSH_MAJOR_VERSION
}
.
${
GMSH_MINOR_VERSION
}
.
${
GMSH_PATCH_VERSION
}
SOVERSION
${
GMSH_MAJOR_VERSION
}
.
${
GMSH_MINOR_VERSION
}
)
if
(
WIN32 OR CYGWIN
)
set_target_properties
(
shared PROPERTIES PREFIX
""
IMPORT_PREFIX
""
IMPORT_SUFFIX
".lib"
COMPILE_FLAGS -DGMSH_DLL_EXPORT
)
IMPORT_SUFFIX
".lib"
COMPILE_FLAGS
"-DGMSH_DLL
-DGMSH_DLL_EXPORT
"
)
endif
(
WIN32 OR CYGWIN
)
target_link_libraries
(
shared
${
LINK_LIBRARIES
}
)
if
(
MSVC AND ENABLE_MSVC_STATIC_RUNTIME
)
...
...
This diff is collapsed.
Click to expand it.
demos/api/crack.py
0 → 100644
+
41
−
0
View file @
213e0dba
import
gmsh
import
sys
gmsh
.
initialize
(
sys
.
argv
)
gmsh
.
fltk
.
initialize
()
gmsh
.
option
.
setNumber
(
"
General.Terminal
"
,
1
)
gmsh
.
model
.
add
(
"
square with cracks
"
)
surf1
=
1
gmsh
.
model
.
occ
.
addRectangle
(
0
,
0
,
0
,
1
,
1
,
surf1
)
pt1
=
gmsh
.
model
.
occ
.
addPoint
(
0.2
,
0.2
,
0
)
pt2
=
gmsh
.
model
.
occ
.
addPoint
(
0.4
,
0.4
,
0
)
line1
=
gmsh
.
model
.
occ
.
addLine
(
pt1
,
pt2
)
pt3
=
gmsh
.
model
.
occ
.
addPoint
(
0.6
,
0.1
,
0
)
pt4
=
gmsh
.
model
.
occ
.
addPoint
(
0.1
,
0.3
,
0
)
line2
=
gmsh
.
model
.
occ
.
addLine
(
pt3
,
pt4
)
o
,
m
=
gmsh
.
model
.
occ
.
fragment
([(
2
,
surf1
)],
[(
1
,
line1
),
(
1
,
line2
)])
gmsh
.
model
.
occ
.
synchronize
()
# m contains, for each input entity (surf1, line1 and line2), the child entities
# (if any) after the fragmentation, as lists of tuples. To apply the crack
# plugin we group all the intersecting lines in a physical group
new_surf
=
m
[
0
][
0
][
1
]
new_lines
=
[
item
[
1
]
for
sublist
in
m
[
1
:]
for
item
in
sublist
]
gmsh
.
model
.
addPhysicalGroup
(
2
,
[
new_surf
],
100
)
gmsh
.
model
.
addPhysicalGroup
(
1
,
new_lines
,
101
)
gmsh
.
model
.
mesh
.
generate
(
2
)
gmsh
.
plugin
.
setNumber
(
"
Crack
"
,
"
PhysicalGroup
"
,
101
)
gmsh
.
plugin
.
run
(
"
Crack
"
)
gmsh
.
fltk
.
run
()
gmsh
.
finalize
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment