Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1618-pythonocc-and-gmsh-api-integration
  • 2824_getDistance_between_shapes
  • 3023-Fillet2D-Update
  • 3115-issue-fix
  • 421-Opencascade_Fillet2D_Chamfer2D_OffsetCurve
  • APIqualityMesure
  • FixNotEnoughRefinementInMiddleCircularPlaneSurface
  • Fixing_frontal_sphere
  • GmshFEM_Gmsh_Opti
  • HierarchicalHDiv
  • HighOrderBLCurving_improve-geom-opt
  • HighOrderMeshOptimizer
  • IntegrableFrameFields
  • MakeSureParallelPlanarSquareSurfaceHaveSameMesh
  • PreserveCompoundEdgesLC
  • PreventEndlessLoopsTetgen
  • RemoveZeroAreaTrianglesParametricSpace
  • Stop-module-shortcuts-from-being-permanently-disabled
  • add-transfiniteautomatic-to-geo
  • addloft
  • alignIrregularVertices
  • alphashapes
  • alphashapes_nooctree
  • better-pyramids
  • bl
  • cenaeroPartition
  • changeForAD
  • closures
  • combination3d
  • constrainedEdges
  • convert_fdivs
  • curl2d
  • curveBL
  • cygwin_conv_path
  • distributed_fwi
  • field-fix-entity
  • fix/fortran-api-example-t4
  • fix/fortran-example-t14
  • fix/search-lib
  • fix_overlaps
  • fixedMeshIF
  • geodesics
  • getEdges
  • hexbl
  • hexdom
  • hierarchical1form
  • hierarchical2
  • high_order_elements
  • hxt_update
  • hyperbolic
  • integrableFrameFields
  • isuruf-master-patch-51992
  • isuruf-master-patch-63355
  • jf
  • macos_arm64
  • master
  • mukadi-master-patch-20923
  • mukadi-master-patch-62503
  • mukadi-mukadi-master-patch-20923-patch-02583
  • netgen
  • new_export_boris
  • occ-features
  • octreeSizeField
  • part_64bit
  • patch_releases_4_10
  • patch_releases_4_12
  • patch_releases_4_8
  • pkgconfig
  • pluginMeshQuality
  • python-cleanup-libpath
  • python_packaging
  • quadMeshingTools
  • quadqs
  • reassign_partitions
  • reducing_files
  • relaying
  • remove_poetry_warning
  • rename-classes
  • revising_tutorials
  • robust_partitions
  • save_edges
  • sizeFieldIso_fix
  • spec_deterministic
  • speed-improvements
  • tmp_jcjc24
  • transfinite-3
  • update-gmm
  • urls_to_https
  • gmsh_0_995
  • gmsh_0_998
  • gmsh_0_999
  • gmsh_1_00
  • gmsh_1_10
  • gmsh_1_11
  • gmsh_1_13
  • gmsh_1_14
  • gmsh_1_15
  • gmsh_1_16
  • gmsh_1_17
  • gmsh_1_18
  • gmsh_1_19
  • gmsh_1_20
  • gmsh_1_21
  • gmsh_1_22
  • gmsh_1_23
  • gmsh_1_231
  • gmsh_1_24
  • gmsh_1_25
  • gmsh_1_26
  • gmsh_1_27
  • gmsh_1_28
  • gmsh_1_29
  • gmsh_1_30
  • gmsh_1_31
  • gmsh_1_32
  • gmsh_1_33
  • gmsh_1_33_4
  • gmsh_1_34
  • gmsh_1_35
  • gmsh_1_35_1
  • gmsh_1_35_2
  • gmsh_1_36
  • gmsh_1_36_1
  • gmsh_1_37
  • gmsh_1_38
  • gmsh_1_39
  • gmsh_1_40
  • gmsh_1_41
  • gmsh_1_42
  • gmsh_1_42_1
  • gmsh_1_43
  • gmsh_1_44
  • gmsh_1_44_1
  • gmsh_1_45
  • gmsh_1_45_1
  • gmsh_1_45_2
  • gmsh_1_46
  • gmsh_1_46_1
  • gmsh_1_47
  • gmsh_1_47_1
  • gmsh_1_48
  • gmsh_1_48_1
  • gmsh_1_49
  • gmsh_1_49_1
  • gmsh_1_49_2
  • gmsh_1_50
  • gmsh_1_51
  • gmsh_1_51_4
  • gmsh_1_51_5
  • gmsh_1_52
  • gmsh_1_52_1
  • gmsh_1_52_2
  • gmsh_1_53
  • gmsh_1_53_1
  • gmsh_1_53_2
  • gmsh_1_54
  • gmsh_1_55
  • gmsh_1_55_1
  • gmsh_1_55_2
  • gmsh_1_55_5
  • gmsh_1_56
  • gmsh_1_56_1
  • gmsh_1_56_2
  • gmsh_1_56_3
  • gmsh_1_57
  • gmsh_1_57_0
  • gmsh_1_58
  • gmsh_1_59
  • gmsh_1_60
  • gmsh_1_60_1
  • gmsh_1_60_2
  • gmsh_1_61
  • gmsh_1_61_1
  • gmsh_1_61_2
  • gmsh_1_61_3
  • gmsh_1_61_4
  • gmsh_1_62
  • gmsh_1_62_1
  • gmsh_1_63
  • gmsh_1_63_2
  • gmsh_1_63_3
  • gmsh_1_63_4
  • gmsh_1_64
  • gmsh_1_64@3821
  • gmsh_1_64_1
  • gmsh_1_64_1@3848
  • gmsh_1_65
  • gmsh_1_65@3940
188 results

Target

Select target project
  • gmsh/gmsh
  • lrp/gmsh
  • nschloe/gmsh
  • romin.tomasetti/gmsh
4 results
Select Git revision
  • HighOrderBLCurving
  • cgnsUnstructured
  • master
  • partitioning
  • poppler
  • gmsh_0_995
  • gmsh_0_998
  • gmsh_0_999
  • gmsh_1_00
  • gmsh_1_10
  • gmsh_1_11
  • gmsh_1_13
  • gmsh_1_14
  • gmsh_1_15
  • gmsh_1_16
  • gmsh_1_17
  • gmsh_1_18
  • gmsh_1_19
  • gmsh_1_20
  • gmsh_1_21
  • gmsh_1_22
  • gmsh_1_23
  • gmsh_1_231
  • gmsh_1_24
  • gmsh_1_25
  • gmsh_1_26
  • gmsh_1_27
  • gmsh_1_28
  • gmsh_1_29
  • gmsh_1_30
  • gmsh_1_31
  • gmsh_1_32
  • gmsh_1_33
  • gmsh_1_33_4
  • gmsh_1_34
  • gmsh_1_35
  • gmsh_1_35_1
  • gmsh_1_35_2
  • gmsh_1_36
  • gmsh_1_36_1
  • gmsh_1_37
  • gmsh_1_38
  • gmsh_1_39
  • gmsh_1_40
  • gmsh_1_41
  • gmsh_1_42
  • gmsh_1_42_1
  • gmsh_1_43
  • gmsh_1_44
  • gmsh_1_44_1
  • gmsh_1_45
  • gmsh_1_45_1
  • gmsh_1_45_2
  • gmsh_1_46
  • gmsh_1_46_1
  • gmsh_1_47
  • gmsh_1_47_1
  • gmsh_1_48
  • gmsh_1_48_1
  • gmsh_1_49
  • gmsh_1_49_1
  • gmsh_1_49_2
  • gmsh_1_50
  • gmsh_1_51
  • gmsh_1_51_4
  • gmsh_1_51_5
  • gmsh_1_52
  • gmsh_1_52_1
  • gmsh_1_52_2
  • gmsh_1_53
  • gmsh_1_53_1
  • gmsh_1_53_2
  • gmsh_1_54
  • gmsh_1_55
  • gmsh_1_55_1
  • gmsh_1_55_2
  • gmsh_1_55_5
  • gmsh_1_56
  • gmsh_1_56_1
  • gmsh_1_56_2
  • gmsh_1_56_3
  • gmsh_1_57
  • gmsh_1_57_0
  • gmsh_1_58
  • gmsh_1_59
  • gmsh_1_60
  • gmsh_1_60_1
  • gmsh_1_60_2
  • gmsh_1_61
  • gmsh_1_61_1
  • gmsh_1_61_2
  • gmsh_1_61_3
  • gmsh_1_61_4
  • gmsh_1_62
  • gmsh_1_62_1
  • gmsh_1_63
  • gmsh_1_63_2
  • gmsh_1_63_3
  • gmsh_1_63_4
  • gmsh_1_64
  • gmsh_1_64@3821
  • gmsh_1_64_1
  • gmsh_1_64_1@3848
  • gmsh_1_65
  • gmsh_1_65@3940
105 results
Show changes
Commits on Source (13370)
Showing with 4013 additions and 5759 deletions
---
BasedOnStyle: None
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowAllArgumentsOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
...
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,modernize-use-auto,modernize-use-nullptr'
CheckOptions:
- key: modernize-use-auto.MinTypeNameLength
value: 40
...
*.geo gitlab-language=cpp
bin*/
lib*/
build*/
install/
contrib/mobile/frameworks_*
contrib/3M
contrib/Parasolid
*.db
doc/cookbook/book
doc/doxygen/html
.DS_Store
*~
*.so
*.so.*
*.mod
*#
*.pyc
## CLion directories
.idea
cmake-build-*
# VS Code directories
.vscode/
# Python virtual environment
venv/
.venv/
# Gmsh - Copyright (C) 1997-2024 C. Geuzaine, J.-F. Remacle
#
# See the LICENSE.txt file in the Gmsh root directory for license information.
# Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
variables:
EXTRA_OPTION: ""
.ssh_config: &ssh_config
before_script:
- echo "$SSH_TOKEN" > ~/.ssh/id_rsa
- echo "Host *" > ~/.ssh/config
- echo "StrictHostKeyChecking no" >> ~/.ssh/config
- chmod 700 ~/.ssh/id_rsa ~/.ssh/config
# ----------------------------------------------
# Continuous integration builds for all branches
# ----------------------------------------------
linux_ci:
image: onelab/ubuntu20.04
script:
- mkdir build
- cd build
- export CXXFLAGS=-Werror
- cmake ..
- make -j 8
- make doc
- ctest -j 8 --output-on-failure
- valgrind --leak-check=full --show-leak-kinds=definite,indirect --error-exitcode=0 ./gmsh ../tutorials/t5.geo -3
tags:
- linux64
- docker
except:
- tags
linux_compatibility_ci:
image: onelab/ubuntu20.04
script:
- mkdir build
- cd build
- cmake -DDEFAULT=0 ..
- make -j 8
- cmake -DENABLE_PARSER=1 ..
- make -j 8
- cmake -DENABLE_POST=1 ..
- make -j 8
- cmake -DENABLE_MESH=1 -DENABLE_BUILD_DYNAMIC=1 -DENABLE_PRIVATE_API=1 -DENABLE_EIGEN=0 -DENABLE_WRAP_PYTHON=1 -DENABLE_PETSC=1 ..
- make -j 8
tags:
- linux64
- docker
except:
- tags
windows_ci:
script:
- md build
- cd build
- c:\cygwin64\bin\bash -c "/usr/bin/cmake -DCMAKE_PREFIX_PATH='/usr/local/opencascade;/usr/local;/usr/x86_64-w64-mingw32/sys-root/mingw' -DCMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=/usr/bin/x86_64-w64-mingw32-g++.exe -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe -DENABLE_OS_SPECIFIC_INSTALL=1 .. && ls"
- c:\cygwin64\bin\bash -c "/usr/bin/make -j 8"
- c:\cygwin64\bin\bash -c "/usr/bin/ctest -j 8 --output-on-failure && ls"
tags:
- windows64
- shared
except:
- tags
windows_msvc_ci:
script:
- md build
- cd build
- cmake -DENABLE_OPENMP=0 ..
- msbuild package.vcxproj
tags:
- windows64
- shared
except:
- tags
# ------------------------------------------
# Official Linux builds (master branch only)
# ------------------------------------------
.linux_official: &linux_official
only:
- master@gmsh/gmsh
<<: *ssh_config
script:
- mkdir build
- cd build
- cmake -DGMSH_HOST=gmsh.info -DENABLE_PETSC=1 -DPETSC_ARCH=real_mumps_seq -DPETSC_DIR=/petsc-3.14.4 ${EXTRA_OPTION} ..
- make package -j 8
- PKG=`ls gmsh-*.tar*`
- scp ${PKG} geuzaine@gmsh.info:.wwwgmsh/bin/Linux/${PKG/\.tar\.gz/\.tgz}
- ctest -j 8 --output-on-failure
tags:
- linux64
- docker
linux_official_snapshot:
image: onelab/debian.stretch.64bit
variables:
EXTRA_OPTION: "-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++"
<<: *linux_official
except:
- tags
linux_official_release:
image: onelab/debian.stretch.64bit
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1 -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++"
<<: *linux_official
only:
- /^gmsh_.*$/
linux-sdk_official_snapshot:
image: onelab/debian.stretch.64bit
variables:
EXTRA_OPTION: "-DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *linux_official
except:
- tags
artifacts:
paths:
- build/_CPack_Packages/
- build/version.txt
expire_in: 1day
linux-sdk_official_release:
image: onelab/debian.stretch.64bit
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *linux_official
only:
- /^gmsh_.*$/
artifacts:
paths:
- build/_CPack_Packages/
- build/version.txt
expire_in: 1day
linux-nox-sdk_official_snapshot:
image: onelab/debian.stretch.64bit
variables:
EXTRA_OPTION: "-DGMSH_EXTRA_VERSION=-nox -DENABLE_FLTK=0 -DENABLE_OCC_CAF=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *linux_official
except:
- tags
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
# --------------------------------------------
# Official Windows builds (master branch only)
# --------------------------------------------
.windows_official: &windows_official
only:
- master@gmsh/gmsh
script:
- md build
- cd build
- c:\cygwin64\bin\bash -c "/usr/bin/cmake -DGMSH_HOST=gmsh.info -DCMAKE_PREFIX_PATH='/usr/local;/usr/x86_64-w64-mingw32/sys-root/mingw' -DCMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=/usr/bin/x86_64-w64-mingw32-g++.exe -DCMAKE_Fortran_COMPILER=/usr/bin/x86_64-w64-mingw32-gfortran.exe -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe -DENABLE_OS_SPECIFIC_INSTALL=1 -DENABLE_PETSC=1 -DPETSC_ARCH=real_mumps_seq -DPETSC_DIR=/home/geuzaine/src/petsc ${EXTRA_OPTION} .."
- c:\cygwin64\bin\bash -c "/usr/bin/make package -j 4"
- c:\cygwin64\bin\bash -c "/usr/bin/scp -o StrictHostKeyChecking=no -i /home/geuzaine/.ssh/id_rsa gmsh-*.zip geuzaine@gmsh.info:.wwwgmsh/bin/Windows/"
- c:\cygwin64\bin\bash -c "/usr/bin/ctest -j 4 --output-on-failure"
windows_official_snapshot:
<<: *windows_official
tags:
- windows64
- official
except:
- tags
windows_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1"
<<: *windows_official
tags:
- windows64
- official
only:
- /^gmsh_.*$/
windows-sdk_official_snapshot:
variables:
EXTRA_OPTION: "-DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *windows_official
tags:
- windows64
- official
except:
- tags
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
windows-sdk_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1 -DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *windows_official
tags:
- windows64
- official
only:
- /^gmsh_.*$/
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
# ------------------------------------------
# Official macOS builds (master branch only)
# ------------------------------------------
.macos_official: &macos_official
only:
- master@gmsh/gmsh
script:
- mkdir build
- cd build
- cmake -DGMSH_HOST=gmsh.info -DENABLE_CAIRO=0 -DENABLE_OS_SPECIFIC_INSTALL=1 -DENABLE_PETSC=1 -DPETSC_ARCH=real_mumps_seq -DPETSC_DIR=/Users/geuzaine/src/petsc ${EXTRA_OPTION} ..
- make package -j 4
- PKG=`ls gmsh-*.[dt][ma][gr]*`
- '[[ ${PKG} == *.dmg ]] && xcrun notarytool submit ${PKG} --key /Users/geuzaine/AuthKey_4R6P5NYF3T.p8 --key-id 4R6P5NYF3T --issuer 69a6de7c-0b3a-47e3-e053-5b8c7c11a4d1 --wait'
- '[[ ${PKG} == *.dmg ]] && xcrun stapler staple ${PKG}'
- scp ${PKG} geuzaine@gmsh.info:.wwwgmsh/bin/macOS/${PKG/\.tar\.gz/\.tgz}
- ctest -j 4 --output-on-failure
macosx_official_snapshot:
<<: *macos_official
tags:
- macos64
- official
except:
- tags
macosx_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1"
<<: *macos_official
tags:
- macos64
- official
only:
- /^gmsh_.*$/
macosx-sdk_official_snapshot:
variables:
EXTRA_OPTION: "-DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *macos_official
tags:
- macos64
- official
except:
- tags
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
macosx-sdk_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1 -DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *macos_official
tags:
- macos64
- official
only:
- /^gmsh_.*$/
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
macosarm_official_snapshot:
<<: *macos_official
tags:
- macos64arm
- official
except:
- tags
macosarm_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1"
<<: *macos_official
tags:
- macos64arm
- official
only:
- /^gmsh_.*$/
macosarm-sdk_official_snapshot:
variables:
EXTRA_OPTION: "-DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *macos_official
tags:
- macos64arm
- official
except:
- tags
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
macosarm-sdk_official_release:
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1 -DENABLE_OS_SPECIFIC_INSTALL=0 -DENABLE_BUILD_DYNAMIC=1 -DINSTALL_SDK_README=1"
<<: *macos_official
tags:
- macos64arm
- official
only:
- /^gmsh_.*$/
artifacts:
paths:
- build/_CPack_Packages/
expire_in: 1day
# ----------------------------------------------
# Official source snapshots (master branch only)
# ----------------------------------------------
.source_official: &source_official
only:
- master@gmsh/gmsh
<<: *ssh_config
script:
- mkdir build_src
- cd build_src
- cmake ${EXTRA_OPTION} ..
- make package_source
- PKG=`ls gmsh-*.tar*`
- scp ${PKG} geuzaine@gmsh.info:.wwwgmsh/src/${PKG/\.tar\.gz/\.tgz}
tags:
- linux64
- docker
source_official_snapshot:
image: onelab/ubuntu20.04
<<: *source_official
except:
- tags
source_official_release:
image: onelab/ubuntu20.04
variables:
EXTRA_OPTION: "-DGMSH_RELEASE=1"
<<: *source_official
only:
- /^gmsh_.*$/
# ----------------------------------------------
# Official documentation (master branch only)
# ----------------------------------------------
doc_official_snapshot:
stage: .post
image: onelab/ubuntu20.04
only:
- master@gmsh/gmsh
<<: *ssh_config
script:
- mkdir build_doc
- cd build_doc
- cmake ..
- make doc
- scp gmsh-*-doc.tgz geuzaine@gmsh.info:.wwwgmsh/doc.tgz
- ssh geuzaine@gmsh.info "cd .wwwgmsh/dev && tar zxvf ../doc.tgz"
tags:
- linux64
- docker
except:
- tags
doc_official_release:
stage: .post
image: onelab/ubuntu20.04
only:
- master@gmsh/gmsh
<<: *ssh_config
script:
- mkdir build_doc
- cd build_doc
- cmake -DGMSH_RELEASE=1 ..
- make doc
- scp gmsh-*-doc.tgz geuzaine@gmsh.info:.wwwgmsh/doc.tgz
- ssh geuzaine@gmsh.info "cd .wwwgmsh && tar zxvf doc.tgz"
- scp ../doc/gmsh.html geuzaine@gmsh.info:.wwwgmsh/
tags:
- linux64
- docker
only:
- /^gmsh_.*$/
# ----------------------------------------------
# Cookbook
# ----------------------------------------------
doc_cookbook:
stage: .post
image: onelab/ubuntu20.04
only:
- gmsh/gmsh
<<: *ssh_config
script:
- mdbook build doc/cookbook
- scp -r doc/cookbook/book geuzaine@gmsh.info:.wwwgmsh/doc/cookbook
tags:
- linux64
- docker
# ----------------------------------------------
# PyPi package
# ----------------------------------------------
pypi_official_snapshot:
stage: .post
image: onelab/ubuntu20.04
only:
- master@gmsh/gmsh
<<: *ssh_config
dependencies:
- linux-sdk_official_snapshot
- linux-nox-sdk_official_snapshot
- windows-sdk_official_snapshot
- macosx-sdk_official_snapshot
- macosarm-sdk_official_snapshot
script:
- cd build
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Linux/TGZ/gmsh-git-Linux64-sdk/ manylinux_2_24_x86_64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Linux/TGZ/gmsh-nox-git-Linux64-sdk/ manylinux_2_24_x86_64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/CYGWIN/ZIP/gmsh-git-Windows64-sdk/ win_amd64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Darwin/TGZ/gmsh-git-MacOSX-sdk/ macosx_10_15_x86_64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Darwin/TGZ/gmsh-git-MacOSARM-sdk/ macosx_12_0_arm64
- scp gmsh-*.dev1+nox*.whl geuzaine@gmsh.info:.wwwgmsh/python-packages-dev-nox/gmsh/
- scp gmsh-*.dev1-*.whl geuzaine@gmsh.info:.wwwgmsh/python-packages-dev/gmsh/
tags:
- linux64
- docker
except:
- tags
pypi_official_release:
stage: .post
image: onelab/ubuntu20.04
only:
- master@gmsh/gmsh
<<: *ssh_config
dependencies:
- linux-sdk_official_release
- windows-sdk_official_release
- macosx-sdk_official_release
- macosarm-sdk_official_release
script:
- echo "[distutils]" > ~/.pypirc
- echo "index-servers = pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "username = __token__" >> ~/.pypirc
- echo "password = $PYPI_TOKEN" >> ~/.pypirc
- cd build
- VERSION=`cat version.txt`
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Linux/TGZ/gmsh-${VERSION}-Linux64-sdk/ manylinux_2_24_x86_64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/CYGWIN/ZIP/gmsh-${VERSION}-Windows64-sdk/ win_amd64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Darwin/TGZ/gmsh-${VERSION}-MacOSX-sdk/ macosx_10_15_x86_64
- python3 ../utils/pypi/sdktowheel.py _CPack_Packages/Darwin/TGZ/gmsh-${VERSION}-MacOSARM-sdk/ macosx_12_0_arm64
- scp gmsh*.whl geuzaine@gmsh.info:.wwwgmsh/python-packages/gmsh/
- twine upload gmsh*.whl
- ssh geuzaine@gmsh.info "cd .wwwgmsh/bin/Linux && rm -f gmsh-stable-Linux64* && ln -s gmsh-${VERSION}-Linux64.tgz gmsh-stable-Linux64.tgz && ln -s gmsh-${VERSION}-Linux64-sdk.tgz gmsh-stable-Linux64-sdk.tgz"
- ssh geuzaine@gmsh.info "cd .wwwgmsh/bin/Windows && rm -f gmsh-stable-Windows64* && ln -s gmsh-${VERSION}-Windows64.zip gmsh-stable-Windows64.zip && ln -s gmsh-${VERSION}-Windows64-sdk.zip gmsh-stable-Windows64-sdk.zip"
- ssh geuzaine@gmsh.info "cd .wwwgmsh/bin/macOS && rm -f gmsh-stable-MacOSX* && ln -s gmsh-${VERSION}-MacOSX.dmg gmsh-stable-MacOSX.dmg && ln -s gmsh-${VERSION}-MacOSX-sdk.tgz gmsh-stable-MacOSX-sdk.tgz"
- ssh geuzaine@gmsh.info "cd .wwwgmsh/bin/macOS && rm -f gmsh-stable-MacOSARM* && ln -s gmsh-${VERSION}-MacOSARM.dmg gmsh-stable-MacOSARM.dmg && ln -s gmsh-${VERSION}-MacOSARM-sdk.tgz gmsh-stable-MacOSARM-sdk.tgz"
- ssh geuzaine@gmsh.info "cd .wwwgmsh/src && rm -f gmsh-stable-source.tgz && ln -s gmsh-${VERSION}-source.tgz gmsh-stable-source.tgz"
tags:
- linux64
- docker
only:
- /^gmsh_.*$/
4.14.0 (Work-in-progress): improve return value of boolean operations; improved
hybrid meshes with pyramids; improved ONELAB parameter GUI; improved XAO export
with mesh sizes; improved unrolled GEO export to handle OCC geometries; new
Step() built-in parser function; upgraded official binary builds with OCC 7.8.
* New API functions: model/getEntityProperties
* Incompatible API changes: new optional arguments to occ/fillet2D; renamed
model/getType as model/getEntityType
4.13.1 (May 24, 2024): fix regression introduced in 4.13.0 when reading binary
.msh files with post-processing data; new read-only Mesh.MinQuality updated
after meshing pipeline; occ/addSurfaceFilling new defaults to degree=2 for
consistency with .geo files; small bug fixes.
4.13.0 (May 7, 2024): added support for importing and exporting XAO files; new
options for OCC boolean operations (OCCBooleanCheckInverted, OCCBooleanGlue,
OCCBooleanNonDestructive, OCCBooleanSimplify); new OCC operations (2D fillets
and chamfers, distance, defeature); new quasi-transfinite 2d meshes (with fans);
small API additions; revert Crack plugin logic to version 4.10.1; bug fixes.
* New API functions: occ/getDistance, occ/fillet2D, occ/chamfer2D,
occ/offsetCurve, occ/defeature, mesh/removeElements, option/restoreDefaults,
logger/getMemory, logger/getTotalMemory.
4.12.2 (January 21, 2024): small bug fixes.
4.12.1 (January 11, 2024): small bug fixes.
4.12.0 (December 21, 2023): new high-order mesh optimisation mode for periodic
meshes; new element qualities available through API; new IGES export; new volume
glyph; OCC curve loops can now be oriented based on the sign of the first curve;
better mesh node visualization; added suppport for model attributes in MSH2
files; new mesh renumbering capabilities in the API; new GAMBIT mesh reader;
replaced Geometry.OCCSafeUnbind with more flexible Geometry.OCCFastUnbind (which
can be set for boolean operations as well); added support for editing STEP
headers; small bug fixes.
* New API functions: model/getEntitiesForPhysicalName, mesh/computeRenumbering,
mesh/getVisibility.
* Incompatible API changes: new optional argument to occ/addCircleArc,
mesh/renumberNodes, mesh/renumberElements and view/getListData; new optional
"interruptible" argument to gmsh.initialize() in Python
4.11.1 (December 21, 2022): Mesh.TransfiniteTri improvements; small bug fixes.
4.11.0 (November 6, 2022): new Fortran API; improved copying ("Duplicata") of
multiple shapes with OCC; reduced default order for OCC surface filling;
arbitrary string attributes can now be stored in models and MSH files; new
Radioss export; added ability to specify spline tangents with OCC; new option
Mesh.SaveWithoutOrphans to prune orphan entities (e.g. geometrical construction
points) from MSH4 files; major overhaul of the reference manual; new official
macOS ARM builds; small bug fixes.
* New API functions: model/getAttributeNames, model/getAttribute,
model/setAttribute, model/removeAttribute
* Incompatible API changes: new argument to mesh/computeHomology; new optional
arguments to occ/addSpline and occ/addThruSections
4.10.5 (July 1, 2022): small bug fixes.
4.10.4 (June 19, 2022): improved graphical window tooltips; small bug fixes.
* New API function: mesh/removeDuplicateElements
4.10.3 (May 26, 2022): small bug fixes.
* New API function: fltk/finalize
4.10.2 (May 13, 2022): fixed regression introduced in 4.9 for recombined meshes
with boundary layers; new Geometry.OCCSafeUnbind option to disable boolean
optimization introduced in 4.10.0 (for backward compatibility); new HealShapes
command in .geo files; simplified calculation of OCC STL bounding boxes;
generalized Crack plugin; small bug fixes.
4.10.1 (May 1, 2022): small bug fixes.
4.10.0 (April 25, 2022): more flexible homology/cohomology workflow in the API;
"Attractor" field is now just a synonym for the newer (and more efficient)
"Distance" field; periodic bsplines now use the same default multiplicities in
OCC as in the built-in kernel; model/isInside now also handles discrete
entities; speed-up repeated simple boolean operations; C++ api now throws
std::runtime_error on errors; small bug fixes.
* New API functions: geo/addGeometry, geo/addPointOnGeometry,
mesh/addHomologyRequest, mesh/clearHomologyRequests, mesh/setVisibility,
mesh/getElementQualities
* Incompatible API changes: additional const qualifiers in C API; removed
mesh/computeCohomology; new arguments to occ/getCurveLoops and
occ/getSurfaceLoops; changed arguments of mesh/computeHomology; new optional
arguments to occ/addCircle, occ/addEllipse, occ/addDisk, occ/addTorus,
occ/addWedge, model/addPhysicalGroup, model/geo/addPhysicalGroup,
mesh/removeDuplicateNodes and mesh/setRecombine.
4.9.5 (February 21, 2022): dynamic Gmsh library now also only exports public
symbols on macOS and Linux, like it does on Windows; better handling of
max. thread settings; small bug fixes.
* New API function: mesh/getDuplicateNodes
4.9.4 (February 3, 2022): improved BSpline filling; new options
Mesh.MinimumLineNodes, Mesh.RecombineNodeRepositioning,
Mesh.RecombineMinimumQuality and Mesh.StlLinearDeflectionRelative; updated
bundled Eigen; small bug fixes.
* New API functions: gmsh/isInitialized, occ/convertToNURBS, occ/getCurveLoops,
occ/getSurfaceLoops, mesh/importStl, parser/getNames, parser/setNumber,
parser/setString, parser/getNumber, parser/getString, parser/clear,
parser/parse, onelab/getChanged, onelab/setChanged
4.9.3 (January 4, 2022): improved handling of degenerate curves in periodic
surfaces and boundary layer extrusion; extended Mesh.SaveGroupsOfElements
capabilities for INP export; extended Mesh.MeshSizeExtendFromBoundary + new
"Extend" mesh size field to enable alternative mesh size extensions from
boundary; enhanced X3D output; moved all kernel sources to src/ subdirectory;
renamed demos/ as examples/ and tutorial/ as tutorials/; small bug fixes.
4.9.2 (December 23, 2021): faster projection on OCC entities; extended
Mesh.SaveGroupsOfNodes capabilities for INP export; improved transfinite meshing
of surfaces with boundary on periodic seam.
4.9.1 (December 18, 2021): relax tolerance on curve parametrization match for
periodic meshing; enable extruded boundary layers on generic model entities;
activate IncludeBoundary by default in Restrict field; downgraded compiler for
official Linux releases to gcc 6 to improve compatibility with older systems;
small bug fixes (view tag generation with zero tag, model/setTag).
4.9.0 (December 3, 2021): new initial 2D meshing algorithm; new quasi-structured
quad algorithm; improved handling of imperfect curve reparametrization on
surfaces in 2D periodic meshing algorithm; mesh renumbering now also renumbers
dependent post-processing views; the mesh size callback is now per-model and its
returned value is not gathered with the other size constraints in a global min
reduction anymore: instead the callback takes as additional argument the mesh
size lc that would be prescribed in the absence of the callback, which allows to
perform any desired modification (the old behavior can be achieved by returning
min(lc, value)); OCC STL representation is now generated using relative
deflection tolerance; new TransformMesh command in .geo files; new behavior of
Mesh.SaveGroupsOf{Nodes,Elements} in UNV and INP exports; partitioned MSH4 files
now contain the full partition topology (i.e. all partition entities); fixed
metric calculation with Eigen (for anisotropic mesh generation); official binary
builds now support OpenMP parallelization and are 64 bit only (build OS upgraded
to Windows 10, macOS 10.15 and Linux glibc 2.24); new experimental Fortran API;
new API functions to handle view options by tag instead of by index; color
options in the API can now be specified as in .geo files, in the form
"Category.Color.Option"; small bug fixes.
* New API functions: model/setTag, mesh/reverse, mesh/affineTransform,
mesh/getMaxNodeTag, mesh/getMaxElementTag, mesh/getSizes, mesh/getPeriodic,
mesh/getAllEdges, mesh/getAllFaces, mesh/addEdge, mesh/addFace,
mesh/getNumberOfPartitions, field/list, field/getType, field/getNumber,
field/getNumbers, field/getString, view/option/setNumber,
view/option/getNumber, view/option/setString, view/option/getString,
view/option/setColor, view/option/getColor, view/option/copy.
* Incompatible API changes: new arguments to mesh/getNode, mesh/getElement and
view/probe; additional argument to the mesh size callback function provided to
mesh/setSizeCallback; new optional arguments to gmsh/initialize,
model/isInside, mesh/partition and occ/addSurfaceFilling; renamed
mesh/preallocateBasisFunctionsOrientationForElements as
mesh/preallocateBasisFunctionsOrientation, mesh/getNumberOfKeysForElements as
mesh/getNumberOfKeys, and mesh/getBasisFunctionsOrientationForElements as
mesh/getBasisFunctionsOrientation; renamed mesh/getKeysForElements as
mesh/getKeys and mesh/getInformationForElements as mesh/getKeysInformation,
and modified their arguments; modified arguments to mesh/getKeysForElement;
removed mesh/getLocalMultipliersForHcurl0; renamed view/copyOptions as
view/option/copy.
4.8.4 (April 28, 2021): set current model in gmsh/model/add; small bug fixes.
4.8.3 (April 6, 2021): better handling of errors in inverse surface mapping;
fixed Mesh.MedFileMinorVersion for MED 4; small bug fixes.
4.8.2 (March 27, 2021): fixed regression in OCC transforms; fixed cwrap API.
4.8.1 (March 21, 2021): improved performance when transforming many OCC
entities; fixed regression in high-order meshing of surfaces with singular
parametrizations; small bug fixes.
4.8.0 (March 2, 2021): new interactive and fully parametrizable definition of
boundary conditions, materials, etc. through ONELAB variables; new API functions
for creating trimmed BSpline/Bezier patches, perform raw triangulations and
tetrehedralizations, get upward adjacencies, and create extruded boundary layers
and automatic curve loops in built-in kernel; improved performance of high-order
meshing of OCC models; improved handling of high resolution displays; new
structured CGNS exporter; new transfinite Beta law; added support for embedded
curves in HXT; added automatic conversion from partitioned MSH2 files to new
partitioned entities; element groups can now be imported from UNV files; fixed
order of Gauss quadrature for quads and hexas; code modernization (C++11);
further uniformization of option names to match the documented terminology
(Mesh.Point -> Mesh.Node, ...; old names are still accepted, but deprecated);
deprecated Mesh.MinimumElementsPerTwoPi: set value directly to
Mesh.MeshSizeFromCurvature instead; Python and Julia APIs now also define "snake
case" aliases for all camelCase function names; small bug fixes and
improvements.
* New API functions: model/getFileName, model/setFileName, model/getAdjacencies,
model/getSecondDerivative, mesh/getEdges, mesh/getFaces, mesh/createEdges,
mesh/createFaces, mesh/removeConstraints, mesh/getEmbedded, mesh/triangulate,
mesh/tetrahedralize, geo/addCurveLoops, fltk/setStatusMessage,
fltk/showContextWindow, fltk/openTreeItem, fltk/closeTreeItem,
onelab/getNames.
* Incompatible API changes: new optional arguments to mesh/classifySurfaces,
occ/addBSplineSurface, occ/addBezierSurface, occ/addPipe and view/probe;
renamed mesh/getEdgeNumber as mesh/getEdges.
4.7.1 (November 16, 2020): small bug fixes and improvements.
4.7.0 (November 5, 2020): API errors now throw exceptions with the last error
message (instead of an integer error code); API functions now print messages on
the terminal by default, and throw exceptions on all errors unless in
interactive mode; new API functions to retrieve "homogeneous" model-based data
(for improved Python performance), to set interpolation matrices for high-order
datasets, to assign "automatic" transfinite meshing constraints and to pass
native (C++, C, Python or Julia) mesh size callback; added option to save
high-order periodic nodes info; added support for scripted window splitting;
improved VTK reader; new MatrixOfInertia command; added support for Unicode
command line arguments on Windows; uniformized commands, options and field
option names to match the documented terminology (CharacteristicLength ->
MeshSize, geometry Line -> Curve, ...; old names are still accepted, but
deprecated); improved handling of complex periodic cases; removed bundled Mmg3D
and added support for stock Mmg 5; Gmsh now requires C++11 and CMake 3.1, and
uses Eigen by default instead of Blas/Lapack for dense linear algebra; small bug
fixes.
* New API functions: model/setVisibilityPerWindow, mesh/setSizeCallback,
mesh/removeSizeCallback, mesh/setTransfiniteAutomatic, geo/addPhysicalGroup,
geo/removePhysicalGroups, view/setInterpolationMatrices,
view/setVisibilityPerWindow, fltk/splitCurrentWindow, fltk/setCurrentWindow,
logger/getLastError.
* Incompatible API changes: new optional argument to geo/addCurveLoop.
4.6.0 (June 22, 2020): new options to only generate initial 2D or 3D meshes
(without node insertion), and to only mesh non-meshed entities; added ability to
only remesh parts of discrete models; added support for mesh size fields and
embedded points and surfaces in HXT; improved reparametrization and partitioning
code; new OCC API functions to reduce the number of synchronizations for complex
models; new OCC spline surface interfaces; new functions and options to control
the first tag of entities, nodes and elements; fixed duplicated entities in STEP
output; improved mesh subdivision and high-order pipeline; MED output now
preserves node and element tags; small bug fixes.
* New API functions: model/getParametrizationBounds, model/isInside,
model/getClosestPoint, model/reparametrizeOnSurface, mesh/rebuildElementCache,
mesh/getBasisFunctionsOrientationForElements,
mesh/getBasisFunctionsOrientationForElement, mesh/getNumberOfOrientations,
mesh/preallocateBasisFunctionsOrientationForElements,
mesh/setSizeAtParametricPoints, geo/setMaxTag, geo/getMaxTag,
occ/addBSplineFilling, occ/addBezierFilling, occ/addBSplineSurface,
occ/addBezierSurface, occ/setMaxTag, occ/getMaxTag, occ/getEntities,
occ/getEntitiesInBoundingBox, occ/getBoundingBox,
view/addHomogeneousModelData.
* Incompatible API changes: new optional arguments to mesh/clear,
mesh/createTopology, mesh/createGeometry, occ/addThruSections,
mesh/getPeriodicNodes; new arguments to mesh/getBasisFunctions; removed
mesh/preallocateBasisFunctions, mesh/precomputeBasisFunctions and
mesh/getBasisFunctionsForElements; renamed occ/setMeshSize as
occ/mesh/setSize.
4.5.6 (March 30, 2020): better calculation of OCC bounding boxes using STL; API
tutorials; small bug fixes.
* New API functions: view/addListDataString, view/getListDataStrings.
4.5.5 (March 21, 2020): tooltips in GUI to help discovery of scripting options;
fixed MED IO of high-order elements; fixed OCC attribute search by bounding box;
fix parsing of mac-encoded scripts; new RecombineMesh command; added support for
extrusion of mixed-dimension entities with OCC; small bug fixes.
4.5.4 (February 29, 2020): periodic mesh optimization now ensures that the
master mesh is not modified; code cleanup; small bug fixes.
4.5.3 (February 22, 2020): improved positioning of corresponding nodes on
periodic entities; improved LaTeX output; improved curve splitting in
reparametrization; new binary PLY reader; small compilation fixes.
* New API functions: mesh/getEdgeNumber, mesh/getLocalMultipliersForHcurl0.
4.5.2 (January 30, 2020): periodic meshes now obey reorientation constraints;
physical group definitions now follow compound meshing constraints; small bug
fixes and improvements.
* New API function: geo/splitCurve.
4.5.1 (December 28, 2019): new Min and Max commands in .geo files;
Mesh.MinimumCirclePoints now behaves the same with all geometry kernels; fixed
issue with UTF16-encoded home directories on Windows.
4.5.0 (December 21, 2019): changed default 2D meshing algorithm to
Frontal-Delaunay; new compound Spline/BSpline commands; new MeshSizeFromBoundary
command; new CGNS importer/exporter; new X3D exporter for geometries and meshes;
improved surface mesh reclassification; new separate option to govern curvature
adapted meshes (Mesh.MinimumElementsPerTwoPi and "-clcurv val"); improved
handling of anisotropic surface meshes in 3D Delaunay; improved high-order
periodic meshing; improved 2D boolean unions; file chooser type is now
changeable at runtime; FLTK GUI can now be created and destroyed at will through
the API; fixed regression in MeshAdapt for non-periodic surfaces with
singularities; combining views now copies options; added API support for mesh
compounds, per-surface mesh algorithm and mesh size from boundary; renamed
plugin AnalyseCurvedMesh to AnalyseMeshQuality; fixed regression for built-in
kernel BSplines on non-flat geometries (Sphere, PolarSphere); small fixes and
improvements.
* New API functions: model/getCurrent, model/getParametrization,
mesh/computeCrossField, mesh/setNode, mesh/getElementsByCoordinates,
mesh/getLocalCoordinatesInElement, mesh/getNumberOfKeysForElements,
mesh/setAlgorithm, mesh.setSizeFromBoundary, mesh/setComound,
geo/addCompoundSpline, geo/addCompoundBSpline, fltk/isAvailable.
* Incompatible API changes: removed mesh/smooth (now handled by mesh/optimize
like all other mesh optimizers); renamed logger/time to logger/getWallTime and
logger/cputime to logger/getCpuTime; new arguments to mesh/optimize,
mesh/getElementProperties and occ/healShapes; added optional argument to
mesh/classifySurfaces and view/combine.
4.4.1 (July 25, 2019): small improvements (transfinite with degenerate curves,
renumbering for some mesh formats, empty MSH file sections, tunable accuracy of
compound meshes) and bug fixes (ellipse < pi, orientation and reclassification
of compound parts, serendip pyramids, periodic MeshAdapt robustness, invalidate
cache after mesh/addNodes).
4.4.0 (July 1, 2019): new STL remeshing workflow (with new ClassifySurfaces
command in .geo files); added API support for color options, mesh optimization,
recombination, smoothing and shape healing; exposed additional METIS options;
improved support for periodic entities (multiple curves with the same start/end
points, legacy MSH2 format, periodic surfaces with embedded entities); added
mesh renumbering also after interactive mesh modifications; improved support for
OpenCASCADE ellipse arcs; new interactive filter in visibility window; flatter
GUI; small bug fixes.
* New API functions: option/setColor, option/getColor, mesh/optimize,
mesh/recombine, mesh/smooth, mesh/clear, mesh/getNodesByElementType,
occ/healShapes.
* Incompatible API changes: mesh/getJacobians and mesh/getBasisFunctions now
take integration points explicitly; mesh/setNodes and mesh/setElements have
been replaced by mesh/addNodes and mesh/addElements; added optional arguments
to mesh/classifySurfaces and occ/addSurfaceLoop; changed arguments of
occ/addEllipseArc to follow geo/addEllipseArc.
4.3.0 (April 19, 2019): improved meshing of surfaces with singular
parametrizations; added API support for aliasing and combining views, copying
view options, setting point coordinates, extruding built-in CAD entities along
normals and retrieving mass, center of mass and inertia from OpenCASCADE CAD
entities; fixed regression introduced in 4.1.4 that could lead to
non-deterministic 2D meshes; small bug fixes.
* New API functions: model/setCoordinates, occ/getMass, occ/getCenterOfMass,
occ/getMatrixOfInertia, view/addAlias, view/copyOptions, view/combine
* Incompatible API changes: added optional arguments to mesh/getNodes and
mesh/getElementByCoordinates.
4.2.3 (April 3, 2019): added STL export by physical surface; added ability to
remove embedded entities; added handling of boundary entities in
addDiscreteEntity; small bug fixes.
* New API functions: mesh/getKeysForElements, mesh/getInformationForElements,
mesh/removeEmbedded.
4.2.2 (March 13, 2019): fixed regression in reading of extruded meshes; added
ability to export one solid per surface in STL format.
4.2.1 (March 7, 2019): fixed regression for STEP files without global compound
shape; added support for reading IGES labels and colors; improved search for
shared library in Python and Julia modules; improved Plugin(MeshVolume); updates
to the reference manual.
4.2.0 (March 5, 2019): new MSH4.1 revision of the MSH file format, with support
for size_t node and element tags (see the reference manual for detailed
changes); added support for reading STEP labels and colors with OCC CAF; changed
default "Geometry.OCCTargetUnit" value to none (i.e. use STEP file coordinates
as-is, without conversion); improved high-order mesh optimization; added ability
to import groups of nodes from MED files; enhanced Plugin(Distance) and
Plugin(SimplePartition); removed unmaintained plugins; removed default
dependency on PETSc; small improvements and bug fixes.
* New API functions: model/setEntityName, model/getEntityName,
model/removeEntityName.
* Incompatible API changes: changed type of node and element tags from int to
size_t to support (very) large meshes; changed logger/start,
mesh/getPeriodicNodes and mesh/setElementsByType.
4.1.5 (February 14, 2019): improved OpenMP parallelization, STL remeshing, mesh
partitioning and high-order mesh optimization; bug fixes.
* New API function: mesh/classifySurfces.
4.1.4 (February 3, 2019): improved ghost cell I/O; small improvements and bug
fixes.
* New API functions: mesh/relocateNodes, mesh/getElementType,
mesh/setElementsByType, mesh/getElementEdgeNodes, mesh/getElementFaceNodes,
mesh/getGhostElements, mesh/splitQuadrangles.
4.1.3 (January 23, 2019): improved quad meshing; new options for automatic
full-quad meshes; save nodesets also for physical points (Abaqus, Tochnog);
small bug fixes.
* New API functions: model/removePhysicalName, model/getPartitions,
mesh/unpartition.
4.1.2 (January 21, 2019): fixed full-quad subdivision if Mesh.SecondOrderLinear
is set; fixed packing of parallelograms regression in 4.1.1.
4.1.1 (January 20, 2019): added support for general affine transformations with
OpenCASCADE kernel; improved handling of boolean tolerance (snap vertices);
faster crossfield calculation by default (e.g. for Frontal-Delauany for quads
algorithm); fixed face vertices for PyramidN; renamed ONELAB "Action" and
"Button" parameters "ONELAB/Action" and "ONELAB/Button"; added support for
actions on any ONELAB button; added API functions for selections in user
interface.
* New API functions: occ/affineTransform, fltk/selectEntities,
fltk/selectElements, fltk/selectViews.
4.1.0 (January 13, 2019): improved ONELAB and Fltk support in API; improved
renumbering of mesh nodes/elements; major code refactoring.
* New API functions: fltk/update, fltk/awake, fltk/lock, fltk/unlock,
onelab/setNumber, onelab/getNumber, onelab/setString, onelab/getString,
onelab/clear, onelab/write, logger/time, logger/cputime.
* Incompatible API changes: changed onelab/get.
4.0.7 (December 9, 2018): fixed small memory leaks; removed unused code.
4.0.6 (November 25, 2018): moved private API wrappers to utils/wrappers;
improved Gmsh 3 compatibility for high-order periodic meshes; fixed '-v 0' not
being completely silent; fixed rendering of image textures on some OSes; small
compilation fixes.
4.0.5 (November 17, 2018): new automatic hybrid mesh generation (pyramid layer)
when 3D Delaunay algorithm is applied to a volume with quadrangles on boundary;
improved robustness of 2D MeshAdapt algorithm; bug fixes.
4.0.4 (October 19, 2018): fixed physical names regression in 4.0.3.
4.0.3 (October 18, 2018): bug fixes.
* New API function: model/removePhysicalGroups.
4.0.2 (September 26, 2018): added support for creating MED files with specific
MED (minor) version; small bug fixes.
4.0.1 (September 7, 2018): renumber mesh nodes/elements by default; new
SendToServer command for nodal views; small bug fixes.
* New API functions: model/setVisibility, model/getVisibility, model/setColor,
model/getColor.
4.0.0 (August 22, 2018): new C++, C, Python and Julia API; new MSH4 format; new
mesh partitioning code based on Metis 5; new 3D tetrahedralization algorithm as
default; new workflow for remeshing (compound entities as meshing constraints,
CreateGeometry for mesh reparametrization); added support for general BSplines,
fillets and chamfers with OpenCASCADE kernel and changed default BSpline
parameters with the built-in kernel to match OpenCASCADE's; STEP files are now
be default interpreted in MKS units (see Geometry.OCCTargetUnit); improved
meshing of surfaces with singular parametrizations (spheres, etc.); uniformized
entity naming conventions (line/curve, vertex/node, etc.); generalized handling
of "all" entities in geo file (using {:} notation); added support for creating
LSDYNA mesh files; removed old CAD creation factory (GModelFactory), old
reparametrization code (G{Edge, Face, Region}Compound) and old partitioning
code (Metis 4 and Chaco); various cleanups, bug fixes and enhancements.
3.0.6 (November 5, 2017): improved meshing of spheres; improved handling of mesh
size constraints with OpenCASCADE kernel; implemented "Coherence" for
OpenCASCADE kernel (shortcut for BooleanFragments); added GAMBIT Neutral File
export; small improvements and bug fixes.
3.0.5 (September 6, 2017): bug fixes.
3.0.4 (July 28, 2017): moved vorometal code to plugin; OpenMP improvements; bug
fixes.
3.0.3 (June 27, 2017): new element quality measures; Block->Box; minor fixes.
3.0.2 (May 13, 2017): improved handling of meshing constraints and entity
numbering after boolean operations; improved handling of fast coarseness
transitions in MeshAdapt; new TIKZ export; small bug fixes.
3.0.1 (April 14, 2017): fixed OpenCASCADE plane surfaces with holes.
3.0.0 (April 13, 2017): new constructive solid geometry features and boolean
operations using OpenCASCADE; improved graphical user interface for interactive,
parametric geometry construction; new or modified commands in .geo files:
SetFactory, Circle, Ellipse, Wire, Surface, Sphere, Block, Torus, Rectangle,
Disk, Cylinder, Cone, Wedge, ThickSolid, ThruSections, Ruled ThruSections,
Fillet, Extrude, BooleanUnion, BooleanIntersection, BooleanDifference,
BooleanFragments, ShapeFromFile, Recursive Delete, Unique; "Surface" replaces
the deprecated "Ruled Surface" command; faster 3D tetrahedral mesh optimization
enabled by default; major code refactoring and numerous bug fixes.
2.16.0 (January 3, 2017): small improvements (list functions, second order hexes
for MED, GUI) and bug fixes.
2.15.0 (December 4, 2016): fixed several regressions (multi-file partitioned
grid export, mesh subdivision, old compound mesher); improved 2D boundary layer
field & removed non-functional 3D boundary layer field; faster rendering of
large meshes.
2.14.1 (October 30, 2016): fixed regression in periodic meshes; small bug fixes
and code cleanups.
2.14.0 (October 9, 2016): new Tochnog file format export; added ability to
remove last command in scripts generated interactively; ONELAB 1.3 with
usability and performance improvements; faster "Coherence Mesh".
2.13.2 (August 18, 2016)): small improvements (scale labels, periodic and
high-order meshes) and bug fixes.
2.13.1 (July 15, 2016): small bug fixes.
2.13.0 (July 11, 2016): new ONELAB 1.2 protocol with native support for lists;
new experimental 3D boundary recovery code and 3D refinement algorithm; better
adaptive visualization of quads and hexahedra; fixed several regressions
introduced in 2.12.
2.12.0 (March 5, 2016): improved interactive definition of physical groups and
handling of ONELAB clients; improved full quad algorithm; added support for list
of strings, trihedra elements and X3D format; improved message console; new
colormaps; various bugs fixes and small improvements all over.
2.11.0 (November 7, 2015): new Else/ElseIf commands; new OptimizeMesh command;
Plugin(ModifyComponents) replaces Plugin(ModifyComponent); new VTK and X3D
outputs; separate 0/Ctrl+0 shortcuts for geometry/full model reload; small bug
fixes in homology solver, handling of embedded entities, and Plugin(Crack).
2.10.1 (July 30, 2015): minor fixes.
2.10.0 (July 21, 2015): improved periodic meshing constraints; new Physical
specification with both label and numeric id; images can now be used as glyphs
in post-processing views, using text annotations with the `file://' prefix;
Views can be grouped and organized in subtrees; improved visibility browser
navigation; geometrical entities and post-processing views can now react to
double-clicks, via new generic DoubleClicked options; new Get/SetNumber and
Get/SetString for direct access to ONELAB variables; small bug fixes and code
cleanups.
2.9.3 (April 18, 2015): updated versions of PETSc/SLEPc and OpenCASCADE/OCE
libraries used in official binary builds; new Find() command; miscellaneous code
cleanups and small fixes.
2.9.2 (March 31, 2015): added support for extrusion of embedded points/curves;
improved hex-dominant algorithm; fixed crashes in quad algorithm; fix regression
in MED reader introduced in 2.9.0; new dark interface mode.
2.9.1 (March 18, 2015): minor bug fixes.
2.9.0 (March 12, 2015): improved robustness of spatial searches (extruded meshes,
geometry coherence); improved reproductibility of 2D and 3D meshes; added
support for high resolution ("retina") graphics; interactive graph point
commands; on-the-fly creation of onelab clients in scripts; general periodic
meshes using afine transforms; scripted selection of entities in bounding boxes;
extended string and list handling functions; many small improvements and bug
fixes.
2.8.5 (Jul 9, 2014): improved stability and error handling, better Coherence
function, updated onelab API version and inline parameter definitions, new
background image modes, more robust Triangulate/Tetrahedralize plugins, new PGF
output, improved support for string~index variable names in parser, small
improvements and bug fixes all over the place.
2.8.4 (Feb 7, 2014): better reproductibility of 2D meshes; new mandatory 'Name'
attribute to define onelab variables in DefineConstant[] & co; new
-setnumber/-setstring command line arguments; small improvements and bug fixes.
2.8.3 (Sep 27, 2013): new quick access menu and multiple view selection in GUI;
enhanced animation creation; many small enhancements and bug fixes.
2.8.2 (Jul 16, 2013): improved high order tools interface; minor bug fixes.
2.8.1 (Jul 11, 2013): improved compound surfaces and transfinite arrangements.
2.8.0 (Jul 8, 2013): improved Delaunay point insertion; fixed mesh orientation
of plane surfaces; fixed mesh size prescribed at embedded points; improved
display of vectors at COG; new experimental text string display engines;
improved fullscreen mode; access time/step in transformations; new experimental
features: AdaptMesh and Surface In Volume; accept unicode file paths on Windows;
compilation and bug fixes.
2.7.1 (May 11, 2013): improved Delaunay point insertion; updated onelab; better
Abaqus and UNV export; small bug and compilation fixes.
2.7.0 (Mar 9, 2013): new single-window GUI, with dynamically customizable
widget tree; faster STEP/BRep import; arbitrary size image export; faster 2D
Delaunay/Frontal algorithms; full option viewer/editor; many bug fixes.
2.6.1 (Jul 15, 2012): minor improvements and bug fixes.
2.6.0 (Jun 19, 2012): new quadrilateral meshing algorithms (Blossom and
Delaunay-Frontal for quads); new solver module based on ONELAB project (requires
FLTK 1.3); new tensor field visualization modes (eigenvectors, ellipsoid, etc.);
added support for interpolation schemes in .msh file; added support for MED3
format; rescale viewport around visible entities (shift+1:1 in GUI); unified
post-processing field export; new experimental stereo+camera visualization mode;
added experimental BAMG & Mmg3D support for anisotropic mesh generation; new OCC
cut & merge algorithm imported from Salome; new ability to connect extruded
meshes to tetrahedral grids using pyramids; new homology solver; Abaqus (INP)
mesh export; new Python and Java wrappers; bug fixes and small improvements all
over the place.
2.5.0 (Oct 15, 2010): new compound geometrical entities (for remeshing and/or
trans-patch meshing); improved mesh reclassification tool; new client/server
visualization mode; new ability to watch a pattern of files to merge; new
integrated MPEG export; new option to force the type of views dynamically;
bumped mesh version format to 2.2 (small change in the meaning of the partition
tags; this only affects partitioned (i.e. parallel) meshes); renamed several
post-processing plugins (as well as plugin options) to make them easier to
understand; many bug fixes and usability improvements all over the place.
2.4.2 (Sep 21, 2009): solver code refactoring + better IDE integration.
2.4.1 (Sep 1, 2009): fixed surface mesh orientation bug introduced in 2.4.0;
mesh and graphics code refactoring, small usability enhancements and bug fixes.
2.4.0 (Aug 22, 2009): switched build system to CMake; optionally copy
transfinite mesh constraints during geometry transformations; bumped mesh
version format to 2.1 (small change in the $PhysicalNames section, where the
group dimension is now required); ported most plugins to the new
post-processing API; switched from MathEval to MathEx and Flu_Tree_Browser to
Fl_Tree; small bug fixes and improvements all over the place.
2.3.1 (Mar 18, 2009): removed GSL dependency (Gmsh now simply uses Blas and
Lapack); new per-window visibility; added support for composite window printing
and background images; fixed string option affectation in parser; fixed surface
mesh orientation for OpenCASCADE models; fixed random triangle orientations in
Delaunay and Frontal algorithms.
2.3.0 (Jan 23, 2009): major graphics and GUI code refactoring; new
full-quad/hexa subdivision algorithm; improved automatic transfinite corner
selection (now also for volumes); improved visibility browser; new automatic
adaptive visualization for high-order simplices; modified arrow size, clipping
planes and transform options; many improvements and bug fixes all over the
place.
2.2.6 (Nov 21, 2008): better transfinite smoothing and automatic corner
selection; fixed high order meshing crashes on Windows and Linux; new uniform
mesh refinement (thanks Brian!); fixed various other small bugs.
2.2.5 (Oct 25, 2008): Gmsh now requires FLTK 1.1.7 or above; various small
improvements (STL and VTK mesh I/O, Netgen upgrade, Visual C++ support, Fields,
Mesh.{Msh,Stl,...}Binary changed to Mesh.Binary) and bug fixes (pyramid
interpolation, Chaco crashes).
2.2.4 (Aug 14, 2008): integrated Metis and Chaco mesh partitioners; variables
can now be deleted in geo files; added support for point datasets in model-based
postprocessing views; small bug fixes.
2.2.3 (Jul 14, 2008): enhanced clipping interface; API cleanup; fixed various
bugs (Plugin(Integrate), high order meshes, surface info crash).
2.2.2 (Jun 20, 2008): added geometrical transformations on volumes; fixed bug in
high order mesh generation.
2.2.1 (Jun 15, 2008): various small improvements (adaptive views, GUI, code
cleanup) and bug fixes (high order meshes, Netgen interface).
2.2.0 (Apr 19, 2008): new model-based post-processing backend; added MED I/O for
mesh and post-processing; fixed BDF vertex ordering for 2nd order elements;
replaced Mesh.ConstrainedBackgroundMesh with
Mesh.CharacteristicLength{FromPoints,ExtendFromBoundary}; new Fields interface;
control windows are now non-modal by default; new experimental 2D frontal
algorithm; fixed various bugs.
2.1.1 (Mar 1, 2008): small bug fixes (second order meshes, combine views, divide
and conquer crash, ...).
2.1.0 (Feb 23, 2008): new post-processing database; complete rewrite of
post-processing drawing code; improved surface mesh algorithms; improved
STEP/IGES/BREP support; new 3D mesh optimization algorithm; new default native
file choosers; fixed 'could not find extruded vertex' in extrusions; many
improvements and bug fixes all over the place.
2.0.8 (Jul 13, 2007): unused vertices are not saved in mesh files anymore; new
plugin GUI; automatic GUI font size selection; renamed
Plugin(DecomposeInSimplex) into Plugin(MakeSimplex); reintroduced enhanced
Plugin(SphericalRaise); clarified meshing algo names; new option to save groups
of nodes in UNV meshes; new background mesh infrastructure; many small
improvements and small bug fixes.
2.0.7 (Apr 3, 2007): volumes can now be defined from external CAD surfaces;
Delaunay/Tetgen algorithm is now used by default when available; re-added
support for Plot3D structured mesh format; added ability to export external CAD
models as GEO files (this only works for the limited set of geometrical
primitives available in the GEO language, of course--so trying to convert e.g. a
trimmed NURBS from a STEP file into a GEO file will fail); "lateral" entities
are now added at the end of the list returned by extrusion commands; fixed
various bugs.
2.0.0 (Feb 5, 2007): new geometry and mesh databases, with support for STEP and
IGES import via OpenCASCADE; complete rewrite of geometry and mesh drawing
code; complete rewrite of mesh I/O layer (with new native binary MSH format and
support for import/export of I-deas UNV, Nastran BDF, STL, Medit MESH and VRML
1.0 files); added support for incomplete second order elements; new 2D and 3D
meshing algorithms; improved integration of Netgen and TetGen algorithms;
removed anisotropic meshing algorithm (as well as attractors); removed explicit
region number specification in extrusions; option changes in the graphical
interface are now applied instantaneously; added support for offscreen rendering
using OSMesa; added support for SVG output; added string labels for Physical
entities; lots of other improvements all over the place.
1.65 (May 15, 2006): new Plugin(ExtractEdges); fixed compilation errors with
gcc4.1; replaced Plugin(DisplacementRaise) and Plugin(SphericalRaise) with the
more flexible Plugin(Warp); better handling of discrete curves; new Status
command in parser; added option to renumber nodes in .msh files (to avoid holes
in the numbering sequence); fixed 2 special cases in quad->prism extrusion;
fixed saving of 2nd order hexas with negative volume; small bug fixes and
cleanups.
1.64 (Mar 18, 2006): Windows versions do no depend on Cygwin anymore; various
bug fixes and cleanups.
1.63 (Feb 01, 2006): post-processing views can now be exported as meshes;
improved background mesh handling (a lot faster, and more accurate); improved
support for input images; new Plugin(ExtractElements); small bug fixes and
enhancements.
1.62 (Jan 15, 2006): new option to draw color gradients in the background;
enhanced perspective projection mode; new "lasso" selection mode (same as
"lasso" zoom, but in selection mode); new "invert selection" button in the
visibility browser; new snapping grid when adding points in the GUI; nicer
normal smoothing; new extrude syntax (old syntax still available, but
deprecated); various small bug fixes and enhancements.
1.61 (Nov 29, 2005): added support for second order (curved) elements in
post-processor; new version (1.4) of post-processing file formats; new stippling
options for 2D plots; removed limit on allowed number of files on command line;
all "Combine" operations are now available in the parser; changed
View.ArrowLocation into View.GlyphLocation; optimized memory usage when loading
many (>1000) views; optimized loading and drawing of line meshes and 2D iso
views; optimized handling of meshes with large number of physical entities;
optimized vertex array creation for large post-processing views on
Windows/Cygwin; removed Discrete Line and Discrete Surface commands (the same
functionality can now be obtained by simply loading a mesh in .msh format);
fixed coloring by mesh partition; added option to light wireframe meshes and
views; new "mesh statistics" export format; new full-quad recombine option; new
Plugin(ModulusPhase); hexas and prisms are now always saved with positive
volume; improved interactive entity selection; new experimental Tetgen
integration; new experimental STL remeshing algorithm; various small bug fixes
and improvements.
1.60 (Mar 15, 2005): added support for discrete curves; new Window menu on Mac
OS X; generalized all octree-based plugins (CutGrid, StreamLines, Probe, etc.)
to handle all element types (and not only scalar and vector
triangles+tetrahedra); generalized Plugin(Evaluate), Plugin(Extract) and
Plugin(Annotate); enhanced clipping plane interface; new grid/axes/rulers for 3D
post-processing views (renamed the AbscissaName, NbAbscissa and AbscissaFormat
options to more general names in the process); better automatic positioning of
2D graphs; new manipulator dialog to specify rotations, translations and
scalings "by hand"; various small enhancements and bug fixes.
1.59 (Feb 06, 2005): added support for discrete (triangulated) surfaces, either
in STL format or with the new "Discrete Surface" command; added STL and Text
output format for post-processing views and STL output format for surface
meshes; all levelset-based plugins can now also compute isovolumes; generalized
Plugin(Evaluate) to handle external view data (based on the same or on a
different mesh); generalized Plugin(CutGrid); new plugins (Eigenvalues,
Gradient, Curl, Divergence); changed default colormap to match Matlab's "Jet"
colormap; new transformation matrix option for views (for non-destructive
rotations, symmetries, etc.); improved solver interface to keep the GUI
responsive during solver calls; new C++ and Python solver examples; simplified
Tools->Visibility GUI; transfinite lines with "Progression" now allow negative
line numbers to reverse the progression; added ability to retrieve Gmsh's
version number in the parser (to help write backward compatible scripts); fixed
white space in unv mesh output; fixed various small bugs.
1.58 (Jan 01, 2005): fixed UNIX socket interface on Windows (broken by the TCP
solver patch in 1.57); bumped version number of default post-processing file
formats to 1.3 (the only small modification is the handling of the end-of-string
character for text2d and text3d objects in the ASCII format); new File->Rename
menu; new colormaps+improved colormap handling; new color+min/max options in
views; new GetValue() function to ask for values interactively in scripts;
generalized For/EndFor loops in parser; new plugins (Annotate, Remove, Probe);
new text attributes in views; renamed some shortcuts; fixed TeX output for large
scenes; new option dialogs for various output formats; fixed many small memory
leaks in parser; many small enhancements to polish the graphics and the user
interface.
1.57 (Dec 23, 2004): generalized displacement maps to display arbitrary view
types; the arrows representing a vector field can now also be colored by the
values from other scalar, vector or tensor fields; new adaptive high order
visualization mode; new options (Solver.SocketCommand, Solver.NameCommand,
View.ArrowSizeProportional, View.Normals, View.Tangents and General.ClipFactor);
fixed display of undesired solver plugin popups; enhanced interactive plugin
behavior; new plugins (HarmonicToTime, Integrate, Eigenvectors); tetrahedral
mesh file reading speedup (50% faster on large meshes); large memory footprint
reduction (up to 50%) for the visualization of triangular/tetrahedral meshes;
the solver interface now supports TCP/IP connections; new generalized raise mode
(allows one to use complex expressions to offset post-processing maps); upgraded
Netgen kernel to version 4.4; new optional TIME list in parsed views to specify
the values of the time steps; several bug fixes in the Elliptic mesh algorithm;
various other small bug fixes and enhancements.
1.56 (Oct 17, 2004): new post-processing option to draw a scalar view raised by
a displacement view without using Plugin(DisplacementRaise) (makes drawing
arbitrary scalar fields on deformed meshes much easier); better post-processing
menu (arbitrary number of views+scrollable+show view number); improved
view->combine; new horizontal post-processing scales; new option to draw the
mesh nodes per element; views can now also be saved in "parsed" format; fixed
various path problems on Windows; small bug fixes.
1.55 (Aug 21, 2004): added background mesh support for Triangle; meshes can now
be displayed using "smoothed" normals (like post-processing views); added GUI
for clipping planes; new interactive clipping/cutting plane definition;
reorganized the Options GUI; enhanced 3D iso computation; enhanced lighting;
many small bug fixes.
1.54 (Jul 03, 2004): integrated Netgen (3D mesh quality optimization +
alternative 3D algorithm); Extrude Surface now always automatically creates a
new volume (in the same way Extrude Point or Extrude Line create new lines and
surfaces, respectively); fixed UNV output; made the "Layers" region numbering
consistent between lines, surfaces and volumes; fixed home directory problem on
Win98; new Plugin(CutParametric); the default project file is now created in the
home directory if no current directory is defined (e.g., when double-clicking on
the icon on Windows/Mac); fixed the discrepancy between the orientation of
geometrical surfaces and the associated surface meshes; added automatic
orientation of surfaces in surface loops; generalized Plugin(Triangulate) to
handle vector and tensor views; much nicer display of discrete iso-surfaces and
custom ranges using smooth normals; small bug fixes and cleanups.
1.53 (Jun 04, 2004): completed support for second order elements in the mesh
module (line, triangles, quadrangles, tetrahedra, hexahedra, prisms and
pyramids); various background mesh fixes and enhancements; major performance
improvements in mesh and post-processing drawing routines (OpenGL vertex arrays
for tri/quads); new Plugin(Evaluate) to evaluate arbitrary expressions on
post-processing views; generalized Plugin(Extract) to handle any combination of
components; generalized "Coherence" to handle transfinite surface/volume
attributes; plugin options can now be set in the option file (like all other
options); added "undo" capability during geometry creation; rewrote the contour
guessing routines so that entities can be selected in an arbitrary order; Mac
users can now double click on geo/msh/pos files in the Finder to launch Gmsh;
removed support for FLTK 1.0; rewrote most of the code related to quadrangles;
fixed 2d elliptic algorithm; removed all OpenGL display list code and options;
fixed light positioning; new BoundingBox command to set the bounding box
explicitly; added support for inexpensive "fake" transparency mode; many code
cleanups.
1.52 (May 06, 2004): new raster ("bitmap") PostScript/EPS/PDF output formats;
new Plugin(Extract) to extract a given component from a post-processing view;
new Plugin(CutGrid) and Plugin(StreamLines); improved mesh projection on
non-planar surfaces; added support for second order tetrahedral elements; added
interactive control of element order; refined mesh entity drawing selection (and
renamed most of the corresponding options); enhanced log scale in
post-processing; better font selection; simplified View.Raise{X,Y,Z} by removing
the scaling; various bug fixes (default postscript printing mode, drawing of 3D
arrows/cylinders on Linux, default home directory on Windows, default initial
file browser directory, extrusion of points with non-normalized axes of
rotation, computation of the scene bounding box in scripts, + the usual
documentation updates).
1.51 (Feb 29, 2004): initial support for visualizing mesh partitions; integrated
version 2.0 of the MSH mesh file format; new option to compute post-processing
ranges (min/max) per time step; Multiple views can now be combined into multi
time step ones (e.g. for programs that generate data one time step at a time);
new syntax: #var[] returns the size of the list var[]; enhanced "gmsh -convert";
temporary and error files are now created in the home directory to avoid file
permission issues; new 3D arrows; better lighting support; STL facets can now be
converted into individual geometrical surfaces; many other small improvements
and bug fixes (multi timestep tensors, color by physical entity, parser cleanup,
etc.).
1.50 (Dec 06, 2003): small changes to the visibility browser + made visibility
scriptable (new Show/Hide commands); fixed (rare) crash when deleting views;
split File->Open into File->Open and File->New to behave like most other
programs; Mac versions now use the system menu bar by default (if possible);
fixed bug leading to degenerate and/or duplicate tetrahedra in extruded meshes;
fixed crash when reloading sms meshes.
1.49 (Nov 30, 2003): made Merge, Save and Print behave like Include (i.e., open
files in the same directory as the main project file if the path is relative);
new Plugin(DecomposeInSimplex); new option View.AlphaChannel to set the
transparency factor globally for a post-processing view; new "Combine Views"
command; various bug fixes and cleanups.
1.48 (Nov 23, 2003): new DisplacementRaise plugin to plot arbitrary fields on
deformed meshes; generalized CutMap, CutPlane, CutSphere and Skin plugins to
handle all kinds of elements and fields; new "Save View[n]" command to save
views from a script; many small bug fixes (configure tests for libpng, handling
of erroneous options, multi time step scalar prism drawings, copy of surface
mesh attributes, etc.).
1.47 (Nov 12, 2003): fixed extrusion of surfaces defined by only two curves; new
syntax to retrieve point coordinates and indices of entities created through
geometrical transformations; new PDF and compressed PostScript output formats;
fixed numbering of elements created with "Extrude Point/Line"; use $GMSH_HOME as
home directory if defined.
1.46 (Aug 23, 2003): fixed crash for very long command lines; new options for
setting the displacement factor and Triangle's parameters + renamed a couple of
options to more sensible names (View.VectorType, View.ArrowSize); various small
bug fixes; documentation update.
1.45 (Jun 14, 2003): small bug fixes (min/max computation for tensor views,
missing physical points in read mesh, "jumping" geometry during interactive
manipulation of large models, etc.); variable definition speedup; restored
support for second order elements in one- and two-dimensional meshes;
documentation updates.
1.44 (Apr 21, 2003): new reference manual; added support for PNG output; fixed
small configure script bugs.
1.43 (Mar 28, 2003): fixed solver interface problem on Mac OS X; new option to
specify the interactive rotation center (default is now the pseudo "center of
gravity" of the object, instead of (0,0,0)).
1.42 (Mar 19, 2003): suppressed the automatic addition of a ".geo" extension if
the file given on the command line is not recognized; added missing Layer option
for Extrude Point; fixed various small bugs.
1.41 (Mar 04, 2003): Gmsh is now licensed under the GNU General Public License;
general code cleanup (indent).
1.40 (Feb 26, 2003): various small bug fixes (mainly GSL-related).
1.39 (Feb 23, 2003): removed all non-free routines; more build system work;
implemented Von-Mises tensor display for all element types; fixed small GUI
bugs.
1.38 (Feb 17, 2003): fixed custom range selection for 3D iso graphs; new build
system based on autoconf; new image reading code to import bitmaps as
post-processing views.
1.37 (Jan 25, 2003): generalized smoothing and cuts of post-processing views;
better Windows integration (solvers, external editors, etc.); small bug fixes.
1.36 (Nov 20, 2002): enhanced view duplication (one can now use "Duplicata
View[num]" in the input file); merged all option dialogs in a new general option
window; enhanced discoverability of the view option menus; new 3D point and line
display; many small bug fixes and enhancements ("Print" format in parser,
post-processing statistics, smooth normals, save window positions, restore
default options, etc.).
1.35 (Sep 11, 2002): graphical user interface upgraded to FLTK 1.1 (tooltips,
new file chooser with multiple selection, full keyboard navigation, cut/paste of
messages, etc.); colors can be now be directly assigned to mesh entities;
initial tensor visualization; new keyboard animation (right/left arrow for time
steps; up/down arrow for view cycling); new VRML output format for surface
meshes; new plugin for spherical elevation plots; new post-processing file
format (version 1.2) supporting quadrangles, hexahedra, prisms and pyramids;
transparency is now enabled by default for post-processing plots; many small bug
fixes (read mesh, ...).
1.34 (Feb 18, 2002): improved surface mesh of non-plane surfaces; fixed
orientation of elements in 2D anisotropic algorithm; minor user interface polish
and additions (mostly in post-processing options); various small bug fixes.
1.33 (Jan 24, 2002): new parameterizable solver interface (allowing up to 5
user-defined solvers); enhanced 2D aniso algorithm; 3D initial mesh speedup.
1.32 (Oct 04, 2001): new visibility browser; better floating point exception
checks; fixed infinite looping when merging meshes in project files; various
small clean ups (degenerate 2D extrusion, view->reload, ...).
1.31 (Nov 30, 2001): corrected ellipses; PostScript output update (better
shading, new combined PS/LaTeX output format); more interface polish; fixed
extra memory allocation in 2D meshes; Physical Volume handling in unv format;
various small fixes.
1.30 (Nov 16, 2001): interface polish; fix crash when extruding quadrangles.
1.29 (Nov 12, 2001): translations and rotations can now be combined in
extrusions; fixed coherence bug in Extrude Line; various small bug fixes and
additions.
1.28 (Oct 30, 2001): corrected the 'Using Progression' attribute for tranfinite
meshes to actually match a real geometric progression; new Triangulate plugin;
new 2D graphs (space+time charts); better performance of geometrical
transformations (warning: the numbering of some automatically created entities
has changed); new text primitives in post-processing views (file format updated
to version 1.1); more robust mean plane computation and error checks; various
other small additions and clean-ups.
1.27 (Oct 05, 2001): added ability to extrude curves with Layers/Recombine
attributes; new PointSize/LineWidth options; fixed For/EndFor loops in included
files; fixed error messages (line numbers+file names) in loops and functions;
made the automatic removal of duplicate geometrical entities optional
(Geometry.AutoCoherence=0); various other small bug fixes and clean-ups.
1.26 (Sep 06, 2001): enhanced 2D anisotropic mesh generator (metric
intersections); fixed small bug in 3D initial mesh; added alternative syntax for
built-in functions (for GetDP compatibility); added line element display; Gmsh
now saves all the elements in the mesh if no physical groups are defined (or if
Mesh.SaveAll=1).
1.25 (Sep 01, 2001): fixed bug with mixed recombined/non-recombined extruded
meshes; Linux versions are now build with no optimization, due to bugs in gcc
2.95.X.
1.24 (Aug 30, 2001): fixed characteristic length interpolation for Splines;
fixed edge swapping bug in 3D initial mesh; fixed degenerated case in
geometrical extrusion (ruled surface with 3 borders); fixed generation of
degenerated hexahedra and prisms for recombined+extruded meshes; added BSplines
creation in the GUI; integrated Jonathan Shewchuk's Triangle as an alternative
isotropic 2D mesh generator; added AngleSmoothNormals to control sharp edge
display with smoothed normals; fixed random crash for lighted 3D iso surfaces.
1.23 (Aug, 2001): fixed duplicate elements generation + non-matching tetrahedra
faces in 3D extruded meshes; better display of displacement maps; fixed
interactive ellipsis construction; generalized boundary operator; added new
explode option for post-processing views; enhanced link view behavior (to update
only the changed items); added new default plugins: Skin, Transform, Smooth;
fixed various other small bugs (mostly in the post-processing module and for
extruded meshes).
1.22 (Aug 03, 2001): fixed (yet another) bug for 2D mesh in the mean plane;
fixed surface coherence bug in extruded meshes; new double logarithmic scale,
saturate value and smoothed normals option for post-processing views; plugins
are now enabled by default; three new experimental statically linked plugins:
CutMap (extracts a given iso surface from a 3D scalar map), CutPlane (cuts a 3D
scalar map with a plane section), CutSphere (cuts a 3D scalar map with a
sphere); various other bug fixes, additions and clean-ups.
1.21 (Jul 25, 2001): fixed more memory leaks; added -opt command line option to
parse definitions directly from the command line; fixed missing screen refreshes
during contour/surface/volume selection; enhanced string manipulation functions
(Sprintf, StrCat, StrPrefix); many other small fixes and clean-ups.
1.20 (Jun 14, 2001): fixed various bugs (memory leaks, functions in included
files, solver command selection, ColorTable option, duplicate nodes in extruded
meshes (not finished yet), infinite loop on empty views, orientation of
recombined quadrangles, ...); reorganized the interface menus; added constrained
background mesh and mesh visibility options; added mesh quality histograms;
changed default mesh colors; reintegrated the old command-line extrusion mesh
generator.
1.19 (May 07, 2001): fixed seg. fault for scalar simplex post-processing; new
Solver menu; interface for GetDP solver through sockets; fixed multiple scale
alignment; added some options + full option descriptions.
1.18 (Apr 26, 2001): fixed many small bugs and incoherences in post-processing;
fixed broken background mesh in 1D mesh generation.
1.17 (Apr 17, 2001): corrected physical points saving; fixed parsing of DOS
files (carriage return problems); easier geometrical selections (cursor change);
plugin manager; enhanced variable arrays (sublist selection and affectation);
line loop check; New arrow display; reduced number of 'fatal' errors + better
handling in interactive mode; fixed bug when opening meshes; enhanced File->Open
behavior for meshes and post-processing views.
1.16 (Feb 26, 2001): added single/double buffer selection (only useful for Unix
versions of Gmsh run from remote hosts without GLX); fixed a bug for recent
versions of the opengl32.dll on Windows, which caused OpenGL fonts not to show
up.
1.15 (Feb 23, 2001): added automatic visibility setting during entity selection;
corrected geometrical extrusion bug.
1.14 (Feb 17, 2001): corrected a few bugs in the GUI (most of them were
introduced in 1.13); added interactive color selection; made the option database
bidirectional (i.e. scripts now correctly update the GUI); default options can
now be saved and automatically reloaded at startup; made some changes to the
scripting syntax (PostProcessing.View[n] becomes View[n]; Offset0 becomes
OffsetX, etc.); corrected the handling of simple triangular surfaces with large
characteristic lengths in the 2D isotropic algorithm; added an ASCII to binary
post-processing view converter.
1.13 (Feb 09, 2001): added support for JPEG output on Windows.
1.12: corrected vector lines in the post-processing parsed format; corrected
animation on Windows; corrected file creation in scripts on Windows; direct
affectation of variable arrays.
1.11 (Feb 07, 2001): corrected included file loading problem.
1.10 (Feb 04, 2001): switched from Motif to FLTK for the GUI. Many small tweaks.
1.00 (Jan 15, 2001): added PPM and YUV output; corrected nested If/Endif;
Corrected several bugs for pixel output and enhanced GIF output (dithering,
transparency); slightly changed the post-processing file format to allow both
single and double precision numbers.
0.999 (Dec 20, 2000): added JPEG output and easy MPEG generation (see t8.geo in
the tutorial); clean up of export functions; small fixes; Linux versions are now
compiled with gcc 2.95.2, which should fix the problems encountered with
Mandrake 7.2.
0.998 (Dec 19, 2000): corrected bug introduced in 0.997 in the generation of the
initial 3D mesh.
0.997 (Dec 14, 2000): corrected bug in interactive surface/volume selection;
Added interactive symmetry; corrected geometrical extrusion with rotation in
degenerated or partially degenerated cases; corrected bug in 2D mesh when
meshing in the mean plane.
0.996: arrays of variables; enhanced Printf and Sprintf; Simplified options
(suppression of option arrays).
0.995 (Dec 11, 2000): totally rewritten geometrical database (performance has
been drastically improved for all geometrical transformations, and most notably
for extrusion). As a consequence, the internal numbering of geometrical entities
has changed: this will cause incompatibilities with old .geo files, and will
require a partial rewrite of your old .geo files if these files made use of
geometrical transformations. The syntax of the .geo file has also been
clarified. Many additions for scripting purposes. New extrusion mesh
generator. Preliminary version of the coupling between extruded and Delaunay
meshes. New option and procedural database. All interactive operations can be
scripted in the input files. See the last example in the tutorial for an
example. Many stability enhancements in the 2D and 3D mesh
algorithms. Performance boost of the 3D algorithm. Gmsh is still slow, but the
performance becomes acceptable. An average 1000 tetrahedra/second is obtained on
a 600Mhz computer for a mesh of one million tetrahedra. New anisotropic 2D mesh
algorithm. New (ASCII and binary) post-processing file format and clarified mesh
file format. New handling for interactive rotations (trackball mode). New
didactic interactive mesh construction (watch the Delaunay algorithm in real
time on complex geometries: that's exciting ;-). And many, many bug fixes and
cleanups.
0.992 (Nov 13, 2000): corrected recombined extrusion; corrected ellipses; added
simple automatic animation of post-processing maps; fixed various bugs.
0.991 (Oct 24, 2000): fixed a serious allocation bug in 2D algorithm, which
caused random crashes. All users should upgrade to 0.991.
0.990: bug fix in non-recombined 3D transfinite meshes.
0.989 (Sep 01, 2000): added ability to reload previously saved meshes; some new
command line options; reorganization of the scale menu; GIF output.
0.987: fixed bug with smoothing (leading to the possible generation of erroneous
3d meshes); corrected bug for mixed 3D meshes; moved the 'toggle view link'
option to Opt->Postprocessing_Options.
0.986: fixed overlay problems; SGI version should now also run on 32 bits
machines; fixed small 3d mesh bug.
0.985: corrected colormap bug on HP, SUN, SGI and IBM versions; corrected small
initialization bug in postscript output.
0.984: corrected bug in display lists; added some options in Opt->General.
0.983: corrected some seg. faults in interactive mode; corrected bug in
rotations; changed default window sizes for better match with 1024x768 screens
(default X resources can be changed: see ex03.geo).
0.982: lighting for mesh and post-processing; corrected 2nd order mesh on non
plane surfaces; added example 13.
# Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
# Gmsh - Copyright (C) 1997-2024 C. Geuzaine, J.-F. Remacle
#
# See the LICENSE.txt file for license information. Please report all
# bugs and problems to <gmsh@geuz.org>.
# See the LICENSE.txt file in the Gmsh root directory for license information.
# Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# if CMAKE_BUILD_TYPE is specified use it; otherwise set the default
# build type to "RelWithDebInfo" ("-O2 -g" with gcc) prior to calling
# project()
if(DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
else(DEFINED CMAKE_BUILD_TYPE)
else()
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
endif(DEFINED CMAKE_BUILD_TYPE)
endif()
project(gmsh CXX C)
option(ENABLE_ACIS "Enable ACIS geometrical models" ON)
option(ENABLE_ANN "Enable ANN to compute Approximate Nearest Neighbors" ON)
option(ENABLE_BAMG "Enable Bamg mesh generator" ON)
option(ENABLE_BFGS "Enable BFGS" ON)
option(ENABLE_BLAS_LAPACK "Use BLAS/Lapack for basic linear algebra" ON)
option(ENABLE_CGNS "Enable CGNS mesh export" OFF)
option(ENABLE_CHACO "Enable Chaco mesh partitioner" ON)
option(ENABLE_DINTEGRATION "Enable discrete integration and levelsets" ON)
option(ENABLE_FLTK "Build FLTK GUI" ON)
option(ENABLE_FL_TREE "Enable FLTK tree browser widget" ON)
option(ENABLE_FOURIER_MODEL "Enable Fourier geometrical models" OFF)
option(ENABLE_GMM "Enable GMM linear algebra solvers" ON)
option(ENABLE_GRAPHICS "Compile-in OpenGL graphics even if there is no GUI" OFF)
option(ENABLE_KBIPACK "Enable Kbipack for homology solver" ON)
option(ENABLE_MATCH "Enable Minimum cost perfect matching algo" ON)
option(ENABLE_MATHEX "Enable MathEx expression parser" ON)
option(ENABLE_MED "Enable MED mesh and post-processing file formats" ON)
option(ENABLE_MESH "Build the mesh module" ON)
option(ENABLE_METIS "Enable Metis mesh partitioner" ON)
option(ENABLE_MMG3D "Enable 3D Mobile Mesh Generation" ON)
option(ENABLE_MPEG_ENCODE "Enable built-in MPEG encoder" ON)
option(ENABLE_MPI "Enable MPI parallelization" OFF)
option(ENABLE_MSVC_STATIC_RUNTIME "Use static Visual C++ runtime" OFF)
option(ENABLE_NATIVE_FILE_CHOOSER "Enable native file chooser in GUI" ON)
option(ENABLE_NETGEN "Enable Netgen mesh generator" ON)
option(ENABLE_OCC "Enable Open CASCADE geometrical models" ON)
option(ENABLE_OSMESA "Use OSMesa for offscreen rendering" OFF)
option(ENABLE_PARSER "Build the GEO file parser" ON)
option(ENABLE_PETSC "Enable PETSc linear algebra solvers" ON)
option(ENABLE_PLUGINS "Build the post-processing plugins" ON)
option(ENABLE_POST "Build the post-processing module" ON)
option(ENABLE_QT "Build QT GUI" OFF)
option(ENABLE_RBF "Enable RBF project" OFF)
option(ENABLE_READLINE "Enable Readline in Lua prompt" ON)
option(ENABLE_SALOME "Enable Salome routines for CAD healing" ON)
option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON)
option(ENABLE_SOLVER "Enable solver components" ON)
option(ENABLE_SWIG "Enable swig" ON)
option(ENABLE_TAUCS "Enable Taucs linear algebra solver" ON)
option(ENABLE_TETGEN "Enable Tetgen mesh generator" ON)
option(ENABLE_TETGEN_NEW "Enable experimental version of Tetgen" OFF)
set(GMSH_MAJOR_VERSION 2)
set(GMSH_MINOR_VERSION 5)
set(GMSH_PATCH_VERSION 1)
set(GMSH_EXTRA_VERSION "" CACHE STRING "Gmsh extra version string")
set(GMSH_VERSION "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}")
set(GMSH_VERSION "${GMSH_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}")
# require C++14 and request C99
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
# this variable controls the default value of the options which are normally set
# to ON (useful if you want to configure a minimal version of Gmsh: e.g. "cmake
# -DDEFAULT=0 -DENABLE_POST=1 -DENABLE_PARSER=1")
set(DEFAULT ON CACHE INTERNAL "Default value for enabled-by-default options")
macro(opt OPTION HELP VALUE)
option(ENABLE_${OPTION} ${HELP} ${VALUE})
set(OPT_TEXI "${OPT_TEXI}\n@item ENABLE_${OPTION}\n${HELP} (default: ${VALUE})")
endmacro()
opt(3M "Enable proprietary 3M extension" OFF)
opt(ALGLIB "Enable ALGLIB (used by some mesh optimizers)" ${DEFAULT})
opt(ANN "Enable ANN (used for fast point search in mesh/post)" ${DEFAULT})
opt(BAMG "Enable Bamg 2D anisotropic mesh generator" ${DEFAULT})
opt(BLAS_LAPACK "Enable BLAS/Lapack for linear algebra (if Eigen if disabled)" OFF)
opt(BLOSSOM "Enable Blossom algorithm (needed for full quad meshing)" ${DEFAULT})
opt(BUILD_LIB "Enable 'lib' target for building static Gmsh library" OFF)
opt(BUILD_SHARED "Enable 'shared' target for building shared Gmsh library" OFF)
opt(BUILD_DYNAMIC "Enable dynamic Gmsh executable (linked with shared library)" OFF)
opt(BUILD_ANDROID "Enable Android NDK library target (experimental)" OFF)
opt(BUILD_IOS "Enable iOS library target (experimental)" OFF)
opt(CGNS "Enable CGNS import/export (experimental)" ${DEFAULT})
opt(CGNS_CPEX0045 "Enable high-order CGNS import/export following CPEX0045 (experimental)" OFF)
opt(CAIRO "Enable Cairo to render fonts (experimental)" ${DEFAULT})
opt(PROFILE "Enable profiling compiler flags" OFF)
opt(DINTEGRATION "Enable discrete integration (needed for levelsets)" ${DEFAULT})
opt(DOMHEX "Enable experimental DOMHEX code" ${DEFAULT})
opt(EIGEN "Enable Eigen for linear algebra (instead of Blas/Lapack)" ON)
opt(FLTK "Enable FLTK graphical user interface (requires mesh/post)" ${DEFAULT})
opt(GEOMETRYCENTRAL "Enable geometry-central library (experimental)" ${DEFAULT})
opt(GETDP "Enable GetDP solver (linked as a library, experimental)" ${DEFAULT})
opt(GMM "Enable GMM linear solvers (simple alternative to PETSc)" ${DEFAULT})
opt(GMP "Enable GMP for Kbipack (advanced)" ON)
opt(GRAPHICS "Enable building graphics lib even without GUI (advanced)" OFF)
opt(HXT "Enable HXT library (for reparametrization and meshing)" ${DEFAULT})
opt(KBIPACK "Enable Kbipack (neeeded by homology solver)" ${DEFAULT})
opt(MATHEX "Enable Mathex expression parser (used by plugins and options)" ${DEFAULT})
opt(MED "Enable MED mesh and post file formats" ${DEFAULT})
opt(MESH "Enable mesh module" ${DEFAULT})
opt(MESQUITE "Enable mesquite" ${DEFAULT})
opt(METIS "Enable Metis mesh partitioner" ${DEFAULT})
opt(MMG "Enable Mmg mesh adaptation interface" ${DEFAULT})
opt(MPEG_ENCODE "Enable built-in MPEG movie encoder" ${DEFAULT})
opt(MPI "Enable MPI (experimental, not used for meshing)" OFF)
opt(MSVC_STATIC_RUNTIME "Enable static Visual C++ runtime" OFF)
opt(MUMPS "Enable MUMPS sparse direct linear solver" OFF)
opt(NETGEN "Enable Netgen 3D frontal mesh generator" ${DEFAULT})
opt(NII2MESH "Enable 3D voxel image to a triangulated mesh" ${DEFAULT})
opt(NUMPY "Enable fullMatrix and numpy array conversion for private API" OFF)
opt(PETSC4PY "Enable petsc4py wrappers for petsc matrices for private API" OFF)
opt(OCC "Enable OpenCASCADE CAD kernel" ${DEFAULT})
opt(OCC_CAF "Enable OpenCASCADE CAF module (for STEP/IGES attributes)" ${DEFAULT})
opt(OCC_STATIC "Link OpenCASCADE static instead of dynamic libraries (requires ENABLE_OCC)" OFF)
opt(OCC_TBB "Add TBB libraries in list of OCC libraries" OFF)
opt(ONELAB "Enable ONELAB solver interface" ${DEFAULT})
opt(ONELAB_METAMODEL "Enable ONELAB metamodels (experimental)" ${DEFAULT})
opt(OPENACC "Enable OpenACC" OFF)
opt(OPENMP "Enable OpenMP" ${DEFAULT})
opt(OPTHOM "Enable high-order mesh optimization tools" ${DEFAULT})
opt(OS_SPECIFIC_INSTALL "Enable OS-specific (e.g. app bundle) installation" OFF)
opt(OSMESA "Enable OSMesa for offscreen rendering (experimental)" OFF)
opt(P4EST "Enable p4est for enabling automatic mesh size field (experimental)" OFF)
opt(PACKAGE_STRIP "Strip symbols in install packages to reduce install size" ON)
opt(PARSER "Enable GEO file parser (required for .geo/.pos scripts)" ${DEFAULT})
opt(PETSC "Enable PETSc linear solvers (required for SLEPc)" OFF)
opt(PLUGINS "Enable post-processing plugins" ${DEFAULT})
opt(POST "Enable post-processing module (required by GUI)" ${DEFAULT})
opt(POPPLER "Enable Poppler for displaying PDF documents (experimental)" OFF)
opt(PRIVATE_API "Enable private API" OFF)
opt(PRO "Enable PRO extensions" ${DEFAULT})
opt(QUADMESHINGTOOLS "Enable QuadMeshingTools extensions" ${DEFAULT})
opt(QUADTRI "Enable QuadTri structured meshing extensions" ${DEFAULT})
opt(REVOROPT "Enable Revoropt (used for CVT remeshing)" OFF)
opt(RPATH "Use RPATH in dynamically linked targets" ON)
opt(SLEPC "Enable SLEPc eigensolvers" OFF)
opt(SOLVER "Enable built-in finite element solvers (required for reparametrization)" ${DEFAULT})
opt(SYSTEM_CONTRIB "Use system versions of contrib libraries, when possible" OFF)
opt(TCMALLOC "Enable libtcmalloc (fast malloc that does not release memory)" OFF)
opt(TESTS "Enable tests" ${DEFAULT})
opt(TINYXML2 "Enable TinyXML2 parser (used by XAO reader)" ${DEFAULT})
opt(TOUCHBAR "Enable Apple Touch bar" ${DEFAULT})
opt(UNTANGLE "Enable 2D and 3D UNTANGLER" ${DEFAULT})
opt(VISUDEV "Enable additional visualization capabilities for development purposes" OFF)
opt(VOROPP "Enable voro++ (for hex meshing, experimental)" ${DEFAULT})
opt(WINSLOWUNTANGLER "Enable WinslowUntangler extensions (requires ALGLIB)" ${DEFAULT})
opt(WRAP_JAVA "Generate SWIG Java wrappers for private API" OFF)
opt(WRAP_PYTHON "Generate SWIG Python wrappers for private API (not used by public API)" OFF)
opt(ZIPPER "Enable Zip file compression/decompression" OFF)
set(GMSH_MAJOR_VERSION 4)
set(GMSH_MINOR_VERSION 14)
set(GMSH_PATCH_VERSION 0)
if(NOT GMSH_EXTRA_VERSION)
set(GMSH_EXTRA_VERSION "")
endif()
set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION}")
set(GMSH_EXTRA_VERSION_ORIG ${GMSH_EXTRA_VERSION})
if(NOT GMSH_RELEASE)
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ERROR_QUIET
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(GIT_COMMIT_HASH)
message(STATUS "Found git hash ${GIT_COMMIT_HASH}")
set(GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}-git-${GIT_COMMIT_HASH}")
else()
message(STATUS "Could not find git hash")
set(GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}-git")
endif()
set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION_TEXI} (development version)")
endif()
set(GMSH_SHORT_VERSION
"${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}")
set(GMSH_VERSION "${GMSH_SHORT_VERSION}${GMSH_EXTRA_VERSION}")
set(GMSH_SHORT_LICENSE "GNU General Public License")
set(GMSH_API
${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h
Common/Gmsh.h Common/GmshDefines.h Common/GmshMessage.h Common/VertexArray.h
Numeric/Numeric.h Numeric/Gauss.h Numeric/polynomialBasis.h
Numeric/JacobianBasis.h Numeric/fullMatrix.h
Numeric/simpleFunction.h Numeric/cartesian.h
Geo/GModel.h Geo/GEntity.h Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h
Geo/GFace.h Geo/GRegion.h Geo/GEdgeLoop.h Geo/GEdgeCompound.h
Geo/GFaceCompound.h Geo/GRegionCompound.h Geo/GRbf.h Geo/MVertex.h Geo/MEdge.h
Geo/MFace.h Geo/MElement.h Geo/MPoint.h Geo/MLine.h Geo/MTriangle.h
Geo/MQuadrangle.h Geo/MTetrahedron.h Geo/MHexahedron.h Geo/MPrism.h
Geo/MPyramid.h Geo/MElementCut.h Geo/discreteVertex.h Geo/discreteEdge.h
Geo/discreteFace.h Geo/discreteRegion.h Geo/SPoint2.h Geo/SPoint3.h
Geo/SVector3.h Geo/STensor3.h Geo/SBoundingBox3d.h Geo/Pair.h Geo/Range.h
Geo/SOrientedBoundingBox.h Geo/CellComplex.h Geo/ChainComplex.h Geo/Cell.h
Geo/Homology.h
Mesh/meshGEdge.h Mesh/meshGFace.h Mesh/meshGFaceOptimize.h
Mesh/meshGFaceDelaunayInsertion.h
Solver/dofManager.h Solver/femTerm.h Solver/laplaceTerm.h Solver/elasticityTerm.h
Solver/crossConfTerm.h Solver/orthogonalTerm.h
Solver/linearSystem.h Solver/linearSystemGMM.h Solver/linearSystemCSR.h
Solver/linearSystemFull.h Solver/elasticitySolver.h
Post/PView.h Post/PViewData.h Plugin/PluginManager.h
Graphics/drawContext.h
contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h
contrib/kbipack/gmp_blas.h contrib/kbipack/mpz.h
contrib/DiscreteIntegration/DILevelset.h)
execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND hostname OUTPUT_VARIABLE HOSTNAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(GMSH_GITLAB_PREFIX "https://gitlab.onelab.info/gmsh/gmsh")
if(GMSH_RELEASE)
string(REPLACE "\." "_" GMSH_SHORT_VERSION_ ${GMSH_SHORT_VERSION})
set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/gmsh_${GMSH_SHORT_VERSION_}")
else()
set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/master")
endif()
set(GMSH_API api/gmsh.h api/gmshc.h api/gmsh.h_cwrap api/gmsh.f90)
if(ENABLE_PRIVATE_API)
message(WARNING "The private API is unsupported and undocumented. It is meant "
"for expert Gmsh developers, not for regular Gmsh users, who should rely "
"on the stable public API (gmsh/api) instead.")
file(GLOB_RECURSE HEADERS src/common/*.h src/numeric/*.h src/numeric/*.hpp
src/geo/*.h src/mesh/*.h src/solver/*.h src/post/*.h src/plugin/*.h
src/graphics/*.h contrib/kbipack/*.h contrib/DiscreteIntegration/*.h
contrib/HighOrderMeshOptimizer/*.h contrib/MeshOptimizer/*.h
contrib/MeshQualityOptimizer/*.h)
set(GMSH_PRIVATE_API ${CMAKE_CURRENT_BINARY_DIR}/src/common/GmshConfig.h
${CMAKE_CURRENT_BINARY_DIR}/src/common/GmshVersion.h ${HEADERS})
get_property(IAMCHILD DIRECTORY PROPERTY PARENT_DIRECTORY)
if(IAMCHILD)
set(GMSH_PRIVATE_API ${GMSH_PRIVATE_API} PARENT_SCOPE)
endif()
if(ENABLE_WRAP_PYTHON OR ENABLE_WRAP_JAVA)
set(ENABLE_BUILD_DYNAMIC ON)
message(WARNING "SWIG wrappers for the private API are unsupported and "
"undocumented. The stable public Python API does not required SWIG.")
endif()
endif()
set(ONELAB_PY contrib/onelab/python/onelab.py)
set(GMSH_PY api/gmsh.py)
set(GMSH_JL api/gmsh.jl)
string(TIMESTAMP DATE "%Y%m%d")
if(NOT DATE)
set(DATE "unknown")
endif(NOT DATE)
endif()
set(GMSH_DATE "${DATE}")
if(NOT HOSTNAME)
set(HOSTNAME "unknown")
endif(NOT HOSTNAME)
set(GMSH_HOST "${HOSTNAME}")
if(NOT PACKAGER)
set(PACKAGER "unknown")
endif(NOT PACKAGER)
set(GMSH_PACKAGER "${PACKAGER}")
if(NOT GMSH_HOST)
execute_process(COMMAND hostname OUTPUT_VARIABLE HOST
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT HOST)
set(HOST "unknown")
endif()
set(GMSH_HOST "${HOST}")
endif()
if(NOT GMSH_PACKAGER)
execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PACKAGER)
set(PACKAGER "unknown")
endif()
string(REPLACE "\\" " " PACKAGER ${PACKAGER})
set(GMSH_PACKAGER "${PACKAGER}")
endif()
if(APPLE)
set(GMSH_OS "MacOSX")
elseif(CYGWIN)
set(GMSH_OS "Windows")
else(APPLE)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
set(GMSH_OS "MacOSARM")
else()
set(GMSH_OS "MacOSX")
endif()
# build universal binary
#SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for macOS" FORCE)
elseif(CYGWIN OR MSYS)
# detect if we use the MinGW compilers on Cygwin - if we do, handle the build
# as a pure Windows build and make cmake find pure Windows import libraries
# (.lib)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
OUTPUT_VARIABLE CXX_COMPILER_MACHINE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(CXX_COMPILER_MACHINE MATCHES "mingw")
set(GMSH_OS "Windows")
set(WIN32 1)
add_definitions(-DWIN32)
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so" ".lib" ".LIB" ".dll" ".DLL" ".dll.a")
endif()
endif()
endif()
if(NOT GMSH_OS)
set(GMSH_OS "${CMAKE_SYSTEM_NAME}")
endif(APPLE)
endif()
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckIncludeFile)
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
macro(set_config_option VARNAME STRING)
set(${VARNAME} TRUE)
list(APPEND CONFIG_OPTIONS ${STRING})
message(STATUS "Found " ${STRING})
endmacro()
# check the size of size_t
check_type_size("size_t" SIZEOF_SIZE_T)
if(SIZEOF_SIZE_T EQUAL 8)
set_config_option(HAVE_64BIT_SIZE_T "64Bit")
endif()
# append 32/64 to the build name on Linux and Windows
if(NOT APPLE)
if(HAVE_64BIT_SIZE_T)
set(GMSH_OS "${GMSH_OS}64")
else()
set(GMSH_OS "${GMSH_OS}32")
endif()
endif()
if(ENABLE_BUILD_DYNAMIC)
set(GMSH_OS "${GMSH_OS}-sdk")
endif()
if(ENABLE_RPATH)
set(CMAKE_MACOSX_RPATH 1)
# make sure that dynamic libraries can be found when installing/ displacing
# the binaries: from https://gitlab.kitware.com/cmake/community/wikis/doc/
# cmake/RPATH-handling:
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already (but later on when
# installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH which point to
# directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib"
isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
if(APPLE)
set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
else()
set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../lib")
endif()
endif()
else()
set(CMAKE_MACOSX_RPATH 0)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
endif()
if(MSVC)
# remove really annoying (and stupid, and wrong) warning about
# bool/int cast performance in Visual C++
set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800)")
if(ENABLE_MSVC_STATIC_RUNTIME)
foreach(VAR
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${VAR} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
endif(${VAR} MATCHES "/MD")
endforeach(VAR)
endif(ENABLE_MSVC_STATIC_RUNTIME)
endif(MSVC)
# remove annoying warning about bool/int cast performance
set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800 4244 4267)")
foreach(VAR
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(ENABLE_MSVC_STATIC_RUNTIME AND ${VAR} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
endif()
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(NOT ${VAR} MATCHES "/MP") # enable parallel compilation
set(${VAR} "${${VAR}} /MP")
endif()
endif()
endforeach()
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()
endif()
endif()
# reduce memory usage of GCC on 32 bit systems
if(NOT HAVE_64BIT_SIZE_T AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --param ggc-min-expand=1 --param ggc-min-heapsize=512000")
endif()
if(ENABLE_OPENMP)
find_package(OpenMP)
if(OpenMP_FOUND OR OPENMP_FOUND)
set_config_option(HAVE_OPENMP "OpenMP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
list(APPEND EXTERNAL_LIBRARIES "${OpenMP_CXX_LIBRARIES}")
elseif(APPLE AND EXISTS "/opt/local/lib/libomp")
# official Apple compiler with macports' libomp
set_config_option(HAVE_OPENMP "OpenMP[MacPorts]")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
list(APPEND EXTERNAL_LIBRARIES "-L/opt/local/lib/libomp -lomp")
elseif(APPLE AND EXISTS "/usr/local/lib/libomp.dylib")
# official Apple compiler with homebrew's libomp on Intel
set_config_option(HAVE_OPENMP "OpenMP[Homebrew]")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp")
list(APPEND EXTERNAL_LIBRARIES "-L/usr/local/lib -lomp")
elseif(APPLE AND EXISTS "/opt/homebrew/opt/libomp")
# official Apple compiler with homebrew's libomp on M processors
set_config_option(HAVE_OPENMP "OpenMP[Homebrew]")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include")
list(APPEND EXTERNAL_LIBRARIES "-L/opt/homebrew/opt/libomp/lib -lomp")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND EXISTS "/usr/local/lib64/libgomp.a")
# custom static openmp for official linux builds
set_config_option(HAVE_OPENMP "OpenMP[static]")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp")
list(APPEND EXTERNAL_LIBRARIES "/usr/local/lib64/libgomp.a")
endif()
endif()
if(ENABLE_OPENACC)
find_package(OpenACC)
if(OpenACC_C_FOUND AND OpenACC_CXX_FOUND)
set_config_option(HAVE_OPENACC "OpenACC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenACC_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenACC_CXX_FLAGS}")
endif()
endif()
if(ENABLE_PROFILE)
# Using the perf set of profiling tools doesn't work without the frame
# pointer and a common optimisation is to remove it
check_cxx_compiler_flag("-fno-omit-frame-pointer" FNOFP)
if(FNOFP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
endif()
endif()
macro(append_gmsh_src DIRNAME FILES)
foreach(FILE ${FILES})
list(APPEND LIST ${DIRNAME}/${FILE})
endforeach(FILE)
endforeach()
set(GMSH_SRC ${GMSH_SRC};${LIST} PARENT_SCOPE)
set(GMSH_DIRS ${GMSH_DIRS};${DIRNAME} PARENT_SCOPE)
endmacro(append_gmsh_src)
endmacro()
macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
set(${VARNAME})
list(LENGTH ${LISTNAME} NUM_LIST)
foreach(LIB ${${LISTNAME}})
find_library(FOUND_LIB ${LIB} PATHS ${PATH} PATH_SUFFIXES ${SUFFIX})
if("${PATH}" STREQUAL "")
find_library(FOUND_LIB ${LIB} PATH_SUFFIXES ${SUFFIX})
else()
find_library(FOUND_LIB ${LIB} PATHS ${PATH} NO_DEFAULT_PATH)
endif()
if(FOUND_LIB)
list(APPEND ${VARNAME} ${FOUND_LIB})
endif(FOUND_LIB)
set(FOUND_LIB FOUND_LIB-NOTFOUND CACHE INTERNAL "")
# unset(FOUND_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
endforeach(LIB)
endif()
unset(FOUND_LIB CACHE)
endforeach()
list(LENGTH ${VARNAME} NUM_FOUND_LIBRARIES)
if(NUM_FOUND_LIBRARIES LESS NUM_LIST)
set(${VARNAME})
endif(NUM_FOUND_LIBRARIES LESS NUM_LIST)
endmacro(find_all_libraries)
macro(set_config_option VARNAME STRING)
set(${VARNAME} TRUE)
list(APPEND CONFIG_OPTIONS ${STRING})
message(STATUS "Found " ${STRING})
endmacro(set_config_option)
# check if the machine is 64 bits (this is more reliable than using
# CMAKE_SIZEOF_VOID_P, which does not seem to work e.g. on some Suse
# machines)
check_type_size("void*" SIZEOF_VOID_P)
if(SIZEOF_VOID_P EQUAL 8)
set_config_option(HAVE_64BIT_SIZE_T "Have64BitSizeT")
endif(SIZEOF_VOID_P EQUAL 8)
if(ENABLE_BLAS_LAPACK)
if(MSVC)
# on Windows with Visual C++ try really hard to find blas/lapack
# *without* requiring a Fortran compiler: 1) try to find the Intel
# MKL libs using the standard search path; if not found 2) try to
# get the reference blas/lapack libs (useful for users with no
# Fortran compiler and no MKL license, who can just download our
# precompiled "gmsh-dep" package)
if(HAVE_64BIT_SIZE_T)
set(MKL_PATH em64t/lib)
else(HAVE_64BIT_SIZE_T)
set(MKL_PATH ia32/lib)
endif(HAVE_64BIT_SIZE_T)
set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas(IntelMKL)")
set_config_option(HAVE_LAPACK "Lapack(IntelMKL)")
else(LAPACK_LIBRARIES)
set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc)
find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "")
endif()
endmacro()
macro(set_compile_flags LISTNAME FLAGS)
foreach(FILE ${${LISTNAME}})
get_source_file_property(PROP ${FILE} COMPILE_FLAGS)
if(PROP)
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${PROP} ${FLAGS}")
else()
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${FLAGS}")
endif()
endforeach()
endmacro()
if(ENABLE_GEOMETRYCENTRAL)
find_library(GEOMETRYCENTRAL_LIB NAMES geometry-central)
find_path(GEOMETRYCENTRAL_INC "surface/meshio.h" PATH_SUFFIXES geometrycentral)
if(GEOMETRYCENTRAL_LIB AND GEOMETRYCENTRAL_INC)
list(APPEND EXTERNAL_LIBRARIES ${GEOMETRYCENTRAL_LIB})
list(APPEND EXTERNAL_INCLUDES ${GEOMETRYCENTRAL_INC})
set_config_option(HAVE_GEOMETRYCENTRAL "geometry-central")
endif()
endif()
if(ENABLE_EIGEN)
if(ENABLE_SYSTEM_CONTRIB)
find_path(EIGEN_INC "Eigen/Dense" PATH_SUFFIXES eigen3)
if(EIGEN_INC)
include_directories(${EIGEN_INC})
set_config_option(HAVE_EIGEN "Eigen")
set(HAVE_CONTRIB_EIGEN FALSE)
endif()
endif()
if(NOT HAVE_EIGEN AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/eigen)
include_directories(contrib/eigen)
set_config_option(HAVE_EIGEN "Eigen[contrib]")
set(HAVE_CONTRIB_EIGEN TRUE)
endif()
# We could also add an option to use BLAS with Eigen
# add_definitions(-DEIGEN_USE_BLAS)
endif()
if(NOT HAVE_EIGEN AND ENABLE_BLAS_LAPACK)
if(BLAS_LAPACK_LIBRARIES)
# use libs as specified in the BLAS_LAPACK_LIBRARIES variable
set_config_option(HAVE_BLAS "Blas[custom]")
set_config_option(HAVE_LAPACK "Lapack[custom]")
set(LAPACK_LIBRARIES ${BLAS_LAPACK_LIBRARIES})
else()
if(MSVC)
# on Windows with Visual C++ try really hard to find blas/lapack *without*
# requiring a Fortran compiler: 1) try to find the Intel MKL libs using
# the standard search path; if not found 2) try to get the reference
# blas/lapack libs (useful for users with no Fortran compiler and no MKL
# license, who can just download our precompiled "gmsh-dep" package)
if(HAVE_64BIT_SIZE_T)
set(MKL_PATH em64t/lib)
set(MKL_LIBS_REQUIRED libguide40 mkl_intel_lp64 mkl_intel_thread mkl_core)
else()
set(MKL_PATH ia32/lib)
set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core)
endif()
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas(Ref)")
set_config_option(HAVE_LAPACK "Lapack(Ref)")
endif(LAPACK_LIBRARIES)
endif(LAPACK_LIBRARIES)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# on Linux try to find the Intel MKL without a Fortran compiler
if(HAVE_64BIT_SIZE_T)
set(MKL_PATH lib/em64t)
else(HAVE_64BIT_SIZE_T)
set(MKL_PATH lib/32)
endif(HAVE_64BIT_SIZE_T)
set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas(IntelMKL)")
set_config_option(HAVE_LAPACK "Lapack(IntelMKL)")
else(LAPACK_LIBRARIES)
# on Linux also try to find ATLAS without a Fortran compiler,
# because cmake ships with a buggy FindBLAS e.g. on Ubuntu Lucid
# Lynx
set(ATLAS_LIBS_REQUIRED lapack f77blas cblas atlas)
find_all_libraries(LAPACK_LIBRARIES ATLAS_LIBS_REQUIRED "" "")
set_config_option(HAVE_BLAS "Blas[mkl]")
set_config_option(HAVE_LAPACK "Lapack[mkl]")
else()
set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc)
find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "")
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas[ref]")
set_config_option(HAVE_LAPACK "Lapack[ref]")
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# on Linux try to find the Intel MKL without a Fortran compiler
if(HAVE_64BIT_SIZE_T)
set(MKL_PATH lib/em64t)
else()
set(MKL_PATH lib/32)
endif()
set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
if(NOT LAPACK_LIBRARIES)
# match lapack 9.0 on 64bit
set(MKL_LIBS_REQUIRED mkl_lapack mkl_em64t guide)
find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
endif()
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas(ATLAS)")
set_config_option(HAVE_LAPACK "Lapack(ATLAS)")
endif(LAPACK_LIBRARIES)
endif(LAPACK_LIBRARIES)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# on SunOS we know blas and lapack are available in sunperf
set(LAPACK_FLAGS -library=sunperf)
set_config_option(HAVE_BLAS "Blas(SubPerf)")
set_config_option(HAVE_LAPACK "Lapack(SunPerf)")
elseif(APPLE)
# on Mac we also know that blas and lapack are available
set(LAPACK_LIBRARIES "-framework vecLib")
set_config_option(HAVE_BLAS "Blas(VecLib)")
set_config_option(HAVE_LAPACK "Lapack(VecLib)")
endif(MSVC)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
# if we haven't found blas and lapack without using the standard
# cmake tests, do it (this requires a working Fortran compiler)
enable_language(Fortran)
find_package(BLAS)
if(BLAS_FOUND)
set_config_option(HAVE_BLAS "Blas")
find_package(LAPACK)
if(LAPACK_FOUND)
set_config_option(HAVE_LAPACK "Lapack")
else(LAPACK_FOUND)
set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif(LAPACK_FOUND)
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
list(APPEND LAPACK_LIBRARIES gfortran)
elseif(CMAKE_Fortran_COMPILER MATCHES "f95")
list(APPEND LAPACK_LIBRARIES gfortran)
elseif(CMAKE_Fortran_COMPILER MATCHES "g77")
list(APPEND LAPACK_LIBRARIES g2c)
endif(CMAKE_Fortran_COMPILER MATCHES "gfortran")
endif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
endif(BLAS_FOUND)
endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
message("WARNING: Could not find Blas or Lapack: most meshing algorithms "
"will not be functional")
endif(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
endif(ENABLE_BLAS_LAPACK)
add_subdirectory(Common)
add_subdirectory(Numeric)
add_subdirectory(Geo)
if(ENABLE_MESH)
add_subdirectory(Mesh)
set_config_option(HAVE_BLAS "Blas[mkl]")
set_config_option(HAVE_LAPACK "Lapack[mkl]")
else()
# on Linux also try to find ATLAS without a Fortran compiler, because
# cmake ships with a buggy FindBLAS e.g. on Ubuntu Lucid Lynx
set(ATLAS_LIBS_REQUIRED lapack f77blas cblas atlas)
find_all_libraries(LAPACK_LIBRARIES ATLAS_LIBS_REQUIRED "" "")
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas[atlas]")
set_config_option(HAVE_LAPACK "Lapack[atlas]")
else()
# try with generic names
set(GENERIC_LIBS_REQUIRED lapack blas pthread)
find_all_libraries(LAPACK_LIBRARIES GENERIC_LIBS_REQUIRED "" "")
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas[generic]")
set_config_option(HAVE_LAPACK "Lapack[generic]")
find_library(GFORTRAN_LIB gfortran)
if(GFORTRAN_LIB)
list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
endif()
endif()
endif()
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# on SunOS we know blas and lapack are available in sunperf
set(LAPACK_LIBRARIES -library=sunperf)
set_config_option(HAVE_BLAS "Blas[sunperf]")
set_config_option(HAVE_LAPACK "Lapack[sunperf]")
elseif(APPLE)
# on Mac we also know that blas and lapack are available
set(LAPACK_LIBRARIES "-llapack -lblas")
set_config_option(HAVE_BLAS "Blas[veclib]")
set_config_option(HAVE_LAPACK "Lapack[veclib]")
endif()
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
# if we haven't found blas and lapack check for OpenBlas
set(OPENBLAS_LIBS_REQUIRED openblas)
find_all_libraries(LAPACK_LIBRARIES OPENBLAS_LIBS_REQUIRED "" "")
if(LAPACK_LIBRARIES)
set_config_option(HAVE_BLAS "Blas[openblas]")
set_config_option(HAVE_LAPACK "Lapack[openblas]")
find_library(GFORTRAN_LIB gfortran)
if(GFORTRAN_LIB)
list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
endif()
endif()
endif()
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
# if we still haven't found blas and lapack, use the standard cmake tests,
# which require a working Fortran compiler
enable_language(Fortran)
find_package(BLAS)
if(BLAS_FOUND)
set_config_option(HAVE_BLAS "Blas")
find_package(LAPACK)
if(LAPACK_FOUND)
set_config_option(HAVE_LAPACK "Lapack")
else()
set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
list(APPEND LAPACK_LIBRARIES gfortran)
elseif(CMAKE_Fortran_COMPILER MATCHES "f95")
list(APPEND LAPACK_LIBRARIES gfortran)
elseif(CMAKE_Fortran_COMPILER MATCHES "g77")
list(APPEND LAPACK_LIBRARIES g2c)
endif()
elseif(CMAKE_Fortran_COMPILER MATCHES "pgi")
list(APPEND LAPACK_LIBRARIES -pgf77libs)
endif()
endif()
endif()
endif()
endif()
if(ENABLE_TCMALLOC)
find_library(TCMALLOC tcmalloc)
if(TCMALLOC)
set_config_option(HAVE_TCMALLOC "TCMalloc")
list(APPEND EXTERNAL_LIBRARIES ${TCMALLOC})
endif()
endif()
add_subdirectory(src/common)
add_subdirectory(src/numeric)
add_subdirectory(src/geo)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/mesh AND ENABLE_MESH)
add_subdirectory(src/mesh)
set_config_option(HAVE_MESH "Mesh")
endif(ENABLE_MESH)
endif()
if(ENABLE_SOLVER)
add_subdirectory(Solver)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/solver AND ENABLE_SOLVER)
add_subdirectory(src/solver)
set_config_option(HAVE_SOLVER "Solver")
endif(ENABLE_SOLVER)
endif()
if(ENABLE_POST)
add_subdirectory(Post)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/post AND ENABLE_POST)
add_subdirectory(src/post)
set_config_option(HAVE_POST "Post")
if(ENABLE_PLUGINS)
add_subdirectory(Plugin)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin AND ENABLE_PLUGINS)
add_subdirectory(src/plugin)
set_config_option(HAVE_PLUGINS "Plugins")
endif(ENABLE_PLUGINS)
endif(ENABLE_POST)
endif()
endif()
if(ENABLE_PARSER)
add_subdirectory(Parser)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/parser AND ENABLE_PARSER)
add_subdirectory(src/parser)
set_config_option(HAVE_PARSER "Parser")
endif(ENABLE_PARSER)
endif()
if(ENABLE_VISUDEV)
set_config_option(HAVE_VISUDEV "VisuDev")
endif()
if(ENABLE_FLTK)
# first, try to use fltk-config for fltk >= 1.3 (FindFLTK is buggy
# on Unix, where e.g. xft and xinerama options are not dealt with)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk AND ENABLE_FLTK)
# first, try to use fltk-config for fltk >= 1.3 (FindFLTK is buggy on Unix,
# where e.g. xft and xinerama options are not dealt with)
find_program(FLTK_CONFIG_SCRIPT fltk-config)
if(FLTK_CONFIG_SCRIPT)
execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --api-version
OUTPUT_VARIABLE FLTK_VERSION)
string(STRIP ${FLTK_VERSION} FLTK_VERSION)
if(FLTK_VERSION GREATER 1.1)
add_subdirectory(Fltk)
string(STRIP "${FLTK_VERSION}" FLTK_VERSION)
if(FLTK_VERSION VERSION_GREATER 1.3)
add_subdirectory(src/fltk)
set_config_option(HAVE_FLTK "Fltk")
message(STATUS "Using fltk-config script for Fltk " ${FLTK_VERSION})
execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --includedir
OUTPUT_VARIABLE FLTK_INCLUDE_DIR)
string(STRIP ${FLTK_INCLUDE_DIR} FLTK_INCLUDE_DIR)
list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR} ${FLTK_INCLUDE_DIR}/FL/images
${FLTK_INCLUDE_DIR}/jpeg ${FLTK_INCLUDE_DIR}/zlib ${FLTK_INCLUDE_DIR}/png)
list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --ldflags
OUTPUT_VARIABLE FLTK_LIBRARIES)
string(STRIP ${FLTK_LIBRARIES} FLTK_LIBRARIES)
string(REGEX MATCH "fltk[_ ]jpeg" FLTK_JPEG ${FLTK_LIBRARIES})
string(REGEX MATCH "fltk[_ ]z" FLTK_Z ${FLTK_LIBRARIES})
string(REGEX MATCH "fltk[_ ]png" FLTK_PNG ${FLTK_LIBRARIES})
endif(FLTK_VERSION GREATER 1.1)
endif(FLTK_CONFIG_SCRIPT)
endif()
endif()
# then try the built-in FindFLTK module
if(NOT HAVE_FLTK)
set(FLTK_SKIP_FORMS TRUE)
set(FLTK_SKIP_FLUID TRUE)
find_package(FLTK)
if(FLTK_FOUND)
add_subdirectory(Fltk)
add_subdirectory(src/fltk)
set_config_option(HAVE_FLTK "Fltk")
list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
# find fltk jpeg
find_library(FLTK_JPEG fltk_jpeg)
if(NOT FLTK_JPEG)
find_library(FLTK_JPEG fltkjpeg)
endif(NOT FLTK_JPEG)
if(FLTK_JPEG)
list(APPEND EXTERNAL_LIBRARIES ${FLTK_JPEG})
foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/jpeg)
endforeach(DIR)
endif(FLTK_JPEG)
# find fltk zlib
find_library(FLTK_Z fltk_z)
if(NOT FLTK_Z)
find_library(FLTK_Z fltkz)
endif(NOT FLTK_Z)
if(FLTK_Z)
list(APPEND EXTERNAL_LIBRARIES ${FLTK_Z})
foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/zlib)
endforeach(DIR)
endif(FLTK_Z)
# find fltk png
find_library(FLTK_PNG fltk_png)
if(NOT FLTK_PNG)
find_library(FLTK_PNG fltkpng)
endif(NOT FLTK_PNG)
if(FLTK_PNG)
list(APPEND EXTERNAL_LIBRARIES ${FLTK_PNG})
foreach(DIR ${FLTK_INCLUDE_DIR})
list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/png)
endforeach(DIR)
endif(FLTK_PNG)
endif(FLTK_FOUND)
endif(NOT HAVE_FLTK)
if(HAVE_FLTK)
if(ENABLE_NATIVE_FILE_CHOOSER)
if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
add_subdirectory(contrib/NativeFileChooser)
include_directories(contrib/NativeFileChooser)
add_definitions(-DFLTK1)
endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
set_config_option(HAVE_NATIVE_FILE_CHOOSER "NativeFileChooser")
endif(ENABLE_NATIVE_FILE_CHOOSER)
if(ENABLE_FL_TREE)
if(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
add_subdirectory(contrib/Fl_Tree)
include_directories(contrib/Fl_Tree)
endif(NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1)
set_config_option(HAVE_FL_TREE "FlTree")
endif(ENABLE_FL_TREE)
endif(HAVE_FLTK)
elseif(ENABLE_QT)
find_package(Qt4)
set(QT_USE_QTOPENGL TRUE)
include(${QT_USE_FILE})
if(QT_FOUND)
add_subdirectory(Qt)
set_config_option(HAVE_QT "Qt")
list(APPEND EXTERNAL_INCLUDES ${QT_INCLUDE_DIR})
endif(QT_FOUND)
endif(ENABLE_FLTK)
if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS)
message(SEND_ERROR "Cannot compile GUI without Mesh, Post or Plugin modules")
endif(NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS)
# get jpeg lib (if we have fltk first try to get the local jpeg lib)
if(FLTK_JPEG)
set_config_option(HAVE_LIBJPEG "Jpeg(Fltk)")
else(FLTK_JPEG)
find_package(JPEG)
if(JPEG_FOUND)
set_config_option(HAVE_LIBJPEG "Jpeg")
list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR})
endif(JPEG_FOUND)
endif(FLTK_JPEG)
# get zlib (if we have fltk first try to get the local zlib)
if(FLTK_Z)
set_config_option(HAVE_LIBZ "Zlib(Fltk)")
else(FLTK_Z)
find_package(ZLIB)
if(ZLIB_FOUND)
set_config_option(HAVE_LIBZ "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND)
endif(FLTK_Z)
# get png lib (if we have fltk first try to get the local png lib)
endif()
endif()
# workaround for Fedora/Suse messing up fltk-config (see issue #417)
if(HAVE_FLTK AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
string(REGEX MATCH "X11" FLTK_X11 ${FLTK_LIBRARIES})
if(NOT FLTK_X11)
find_package(X11)
if(X11_FOUND)
list(APPEND EXTERNAL_INCLUDES ${X11_INCLUDE_DIR})
list(APPEND EXTERNAL_LIBRARIES ${X11_LIBRARIES})
endif()
endif()
endif()
endif()
if(APPLE AND HAVE_FLTK AND ENABLE_TOUCHBAR)
STRING(REGEX MATCH "([0-9]+.[0-9]+)" OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
if(OSX_SDK_VERSION)
if(${OSX_SDK_VERSION} VERSION_GREATER 10.11)
set(GMSH_SRC ${GMSH_SRC};src/fltk/touchBar.mm)
set_config_option(HAVE_TOUCHBAR "TouchBar")
endif()
endif()
endif()
if(ENABLE_ONELAB)
set_config_option(HAVE_ONELAB "ONELAB")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/onelab)
if(ENABLE_ONELAB_METAMODEL)
add_subdirectory(contrib/onelab)
include_directories(contrib/onelab)
set_config_option(HAVE_ONELAB_METAMODEL "ONELABMetamodel")
endif()
file(COPY ${ONELAB_PY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()
endif()
if(ENABLE_BUILD_IOS)
find_file(CMAKE_TOOLCHAIN_FILE "ios.cmake")
if(NOT CMAKE_TOOLCHAIN_FILE)
message(FATAL_ERROR "Cannot compile Gmsh for iOS without a toolchain")
endif()
add_definitions(-DBUILD_IOS)
endif()
if(HAVE_FLTK OR ENABLE_GRAPHICS)
if(NOT HAVE_POST OR NOT HAVE_PLUGINS OR NOT HAVE_ONELAB)
message(SEND_ERROR "Cannot compile GUI without Post, Plugin and ONELAB")
endif()
find_package(JPEG)
if(JPEG_FOUND)
set_config_option(HAVE_LIBJPEG "Jpeg")
list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR})
endif()
find_package(ZLIB)
if(ZLIB_FOUND)
set_config_option(HAVE_LIBZ "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
endif()
if(HAVE_LIBZ)
if(FLTK_PNG)
set_config_option(HAVE_LIBPNG "Png(Fltk)")
else(FLTK_PNG)
find_package(PNG)
if(PNG_FOUND)
set_config_option(HAVE_LIBPNG "Png")
list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR})
endif(PNG_FOUND)
endif(FLTK_PNG)
endif(HAVE_LIBZ)
find_package(OpenGL REQUIRED)
if(OPENGL_GLU_FOUND)
add_subdirectory(Graphics)
set_config_option(HAVE_OPENGL "OpenGL")
else(OPENGL_GLU_FOUND)
message(SEND_ERROR "Could not find GLU: disabling OpenGL support")
endif(OPENGL_GLU_FOUND)
endif(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
find_package(PNG)
if(PNG_FOUND)
set_config_option(HAVE_LIBPNG "Png")
list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR})
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/mpeg_encode AND
ENABLE_MPEG_ENCODE)
add_subdirectory(contrib/mpeg_encode)
include_directories(contrib/mpeg_encode/headers)
set_config_option(HAVE_MPEG_ENCODE "Mpeg")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/3M AND ENABLE_3M)
add_subdirectory(contrib/3M)
include_directories(contrib/3M)
set_config_option(HAVE_3M "3M")
endif()
if(ENABLE_OSMESA)
find_library(OSMESA_LIB OSMesa)
if(OSMESA_LIB)
set_config_option(HAVE_OSMESA "OSMesa")
list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB})
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/graphics)
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL REQUIRED)
if(OPENGL_GLU_FOUND AND OPENGL_FOUND)
add_subdirectory(src/graphics)
set_config_option(HAVE_OPENGL "OpenGL")
else()
message(SEND_ERROR "Could not find GLU: disabling OpenGL support")
endif()
endif()
endif()
if(ENABLE_ANN)
add_subdirectory(contrib/ANN)
include_directories(contrib/ANN/include)
set_config_option(HAVE_ANN "Ann")
endif(ENABLE_ANN)
if(ENABLE_CHACO)
add_subdirectory(contrib/Chaco)
include_directories(contrib/Chaco/main)
set_config_option(HAVE_CHACO "Chaco")
endif(ENABLE_CHACO)
if(ENABLE_BFGS)
add_subdirectory(contrib/lbfgs)
include_directories(contrib/lbfgs)
set_config_option(HAVE_BFGS "Bfgs")
endif(ENABLE_BFGS)
if(ENABLE_DINTEGRATION)
find_library(ANN_LIB ANN PATH_SUFFIXES lib)
find_path(ANN_INC "ANN.h" PATH_SUFFIXES src include ANN)
if(ENABLE_SYSTEM_CONTRIB AND ANN_LIB AND ANN_INC)
message(STATUS "Using system version of ANN")
list(APPEND EXTERNAL_LIBRARIES ${ANN_LIB})
list(APPEND EXTERNAL_INCLUDES ${ANN_INC})
set_config_option(HAVE_ANN "ANN")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ANN)
add_subdirectory(contrib/ANN)
include_directories(contrib/ANN/include)
set_config_option(HAVE_ANN "ANN[contrib]")
endif()
endif()
if(ENABLE_ALGLIB)
find_library(ALGLIB_LIB alglib)
find_path(ALGLIB_INC "stdafx.h" PATH_SUFFIXES libalglib)
if(ENABLE_SYSTEM_CONTRIB AND ALGLIB_LIB AND ALGLIB_INC)
list(APPEND EXTERNAL_LIBRARIES ${ALGLIB_LIB})
list(APPEND EXTERNAL_INCLUDES ${ALGLIB_INC})
set_config_option(HAVE_ALGLIB "ALGLIB")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ALGLIB)
add_subdirectory(contrib/ALGLIB)
include_directories(contrib/ALGLIB)
set_config_option(HAVE_ALGLIB "ALGLIB[contrib]")
endif()
endif()
if(HAVE_FLTK AND ENABLE_CAIRO)
find_library(CAIRO_LIB cairo)
find_path(CAIRO_INC "cairo/cairo.h" PATH_SUFFIXES include)
if(CAIRO_INC AND CAIRO_LIB)
set_config_option(HAVE_CAIRO "Cairo")
list(APPEND EXTERNAL_LIBRARIES ${CAIRO_LIB})
list(APPEND EXTERNAL_INCLUDES ${CAIRO_INC})
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/DiscreteIntegration AND
ENABLE_DINTEGRATION)
add_subdirectory(contrib/DiscreteIntegration)
include_directories(contrib/DiscreteIntegration)
set_config_option(HAVE_DINTEGRATION "DIntegration")
endif(ENABLE_DINTEGRATION)
if(ENABLE_GMM)
include_directories(contrib/gmm)
set_config_option(HAVE_GMM "Gmm")
endif(ENABLE_GMM)
if(ENABLE_KBIPACK)
find_library(GMP_LIB NAMES gmp)
if(GMP_LIB)
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/kbipack AND ENABLE_KBIPACK)
set_config_option(HAVE_KBIPACK "Kbipack")
add_subdirectory(contrib/kbipack)
include_directories(contrib/kbipack)
if(ENABLE_GMP)
find_library(GMP_LIB gmp)
find_path(GMP_INC "gmp.h" PATH_SUFFIXES src include)
if(GMP_INC)
set_config_option(HAVE_GMP "GMP")
list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB})
list(APPEND EXTERNAL_INCLUDES ${GMP_INC})
add_subdirectory(contrib/kbipack)
include_directories(contrib/kbipack)
set_config_option(HAVE_KBIPACK "Kbipack")
endif(GMP_INC)
endif(GMP_LIB)
endif(ENABLE_KBIPACK)
endif()
if(GMP_LIB AND GMP_INC)
set_config_option(HAVE_GMP "GMP")
list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB})
list(APPEND EXTERNAL_INCLUDES ${GMP_INC})
else()
message(STATUS "GMP not found: Kbipack uses long int")
endif()
endif()
if(ENABLE_MATHEX)
add_subdirectory(contrib/MathEx)
include_directories(contrib/MathEx)
set_config_option(HAVE_MATHEX "MathEx")
endif(ENABLE_MATHEX)
find_library(MATHEX_LIB mathex PATH_SUFFIXES lib)
find_path(MATHEX_INC "mathex.h" PATH_SUFFIXES src include)
if(ENABLE_SYSTEM_CONTRIB AND MATHEX_LIB AND MATHEX_INC)
list(APPEND EXTERNAL_LIBRARIES ${MATHEX_LIB})
list(APPEND EXTERNAL_INCLUDES ${MATHEX_INC})
set_config_option(HAVE_MATHEX "MathEx")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MathEx)
add_subdirectory(contrib/MathEx)
include_directories(contrib/MathEx)
set_config_option(HAVE_MATHEX "MathEx[contrib]")
endif()
endif()
if(ENABLE_TINYXML2)
find_library(TINYXML2_LIB tinyxml2 PATH_SUFFIXES lib)
find_path(TINYXML2_INC "tinyxml2.h" PATH_SUFFIXES src include)
if(ENABLE_SYSTEM_CONTRIB AND TINYXML2_LIB AND TINYXML2_INC)
list(APPEND EXTERNAL_LIBRARIES ${TINYXML2_LIB})
list(APPEND EXTERNAL_INCLUDES ${TINYXML2_INC})
set_config_option(HAVE_TINYXML2 "TinyXML2")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/tinyxml2)
add_subdirectory(contrib/tinyxml2)
include_directories(contrib/tinyxml2)
set_config_option(HAVE_TINYXML2 "TinyXML2[contrib]")
endif()
endif()
if(ENABLE_MPI)
find_package(MPI)
if(MPI_FOUND)
set_config_option(HAVE_MPI "MPI")
list(APPEND EXTERNAL_INCLUDES ${MPI_INCLUDE_DIR})
list(APPEND EXTERNAL_LIBRARIES ${MPI_LIBRARIES})
include(CMakeForceCompiler)
cmake_force_cxx_compiler(${MPI_COMPILER} "MPI C++ Compiler")
endif(MPI_FOUND)
endif(ENABLE_MPI)
if(ENABLE_MPEG_ENCODE)
add_subdirectory(contrib/mpeg_encode)
include_directories(contrib/mpeg_encode/headers)
set_config_option(HAVE_MPEG_ENCODE "Mpeg")
endif(ENABLE_MPEG_ENCODE)
if(ENABLE_METIS)
add_subdirectory(contrib/Metis)
include_directories(contrib/Metis)
set_config_option(HAVE_METIS "Metis")
message("WARNING: By including Metis you have to comply with Metis' special "
"licensing requirements stated in contrib/Metis/README.txt.")
endif(ENABLE_METIS)
find_package(MPI)
if(MPI_FOUND)
set_config_option(HAVE_MPI "MPI")
list(APPEND EXTERNAL_INCLUDES ${MPI_CXX_INCLUDE_PATH})
list(APPEND EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES})
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})
endif()
endif()
if(ENABLE_MESQUITE)
find_library(MESQUITE_LIB mesquite)
find_path(MESQUITE_INC "Mesquite.hpp" PATH_SUFFIXES src include)
if(MESQUITE_LIB AND MESQUITE_INC)
set_config_option(HAVE_MESQUITE "Mesquite")
list(APPEND EXTERNAL_LIBRARIES ${MESQUITE_LIB})
list(APPEND EXTERNAL_INCLUDES ${MESQUITE_INC})
endif()
endif()
if(ENABLE_POPPLER)
find_library(POPPLER_LIB poppler)
find_library(POPPLER_CPP_LIB poppler-cpp)
find_path(POPPLER_INC "poppler/cpp/poppler-document.h" PATH_SUFFIXES src include)
if(POPPLER_LIB AND POPPLER_INC)
set_config_option(HAVE_POPPLER "Poppler")
list(APPEND EXTERNAL_LIBRARIES ${POPPLER_LIB})
list(APPEND EXTERNAL_LIBRARIES ${POPPLER_CPP_LIB})
list(APPEND EXTERNAL_INCLUDES ${POPPLER_INC})
endif()
endif()
if(ENABLE_P4EST)
find_library(P4EST_LIB p4est)
find_path(P4EST_INC "p4est.h" PATH_SUFFIXES src)
find_library(SC_LIB sc)
if(P4EST_LIB AND P4EST_INC AND SC_LIB)
set_config_option(HAVE_P4EST "P4est")
list(APPEND EXTERNAL_LIBRARIES ${P4EST_LIB} ${SC_LIB})
list(APPEND EXTERNAL_INCLUDES ${P4EST_INC})
endif()
endif()
if(HAVE_MESH OR HAVE_SOLVER)
if(ENABLE_METIS)
find_library(METIS_LIB metis PATH_SUFFIXES lib)
find_path(METIS_INC "metis.h" PATH_SUFFIXES include)
if(ENABLE_SYSTEM_CONTRIB AND METIS_LIB AND METIS_INC)
message(STATUS "Using system version of METIS")
list(APPEND EXTERNAL_LIBRARIES ${METIS_LIB})
list(APPEND EXTERNAL_INCLUDES ${METIS_INC})
set_config_option(HAVE_METIS "Metis")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/metis)
add_definitions(-DUSE_GKREGEX)
add_subdirectory(contrib/metis)
include_directories(contrib/metis/include contrib/metis/libmetis
contrib/metis/GKlib)
set_config_option(HAVE_METIS "Metis[contrib]")
endif()
endif()
endif()
if(HAVE_MESH)
if(ENABLE_NETGEN)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/mesh/tetgenBR.cxx)
set_config_option(HAVE_TETGENBR "TetGen/BR")
endif()
if(ENABLE_VOROPP)
find_library(VOROPP_LIB voro++)
find_path(VOROPP_INC "voro++.hh" PATH_SUFFIXES voro++)
if(ENABLE_SYSTEM_CONTRIB AND VOROPP_LIB AND VOROPP_INC)
message(STATUS "Using system version of voro++")
list(APPEND EXTERNAL_LIBRARIES ${VOROPP_LIB})
list(APPEND EXTERNAL_INCLUDES ${VOROPP_INC})
set_config_option(HAVE_VOROPP "Voro++")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/voro++)
add_subdirectory(contrib/voro++)
include_directories(contrib/voro++/src)
set_config_option(HAVE_VOROPP "Voro++[contrib]")
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/HighOrderMeshOptimizer AND
EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshOptimizer AND
EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshQualityOptimizer AND
ENABLE_OPTHOM)
add_subdirectory(contrib/HighOrderMeshOptimizer)
include_directories(contrib/HighOrderMeshOptimizer)
add_subdirectory(contrib/MeshOptimizer)
include_directories(contrib/MeshOptimizer)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/contrib/MeshOptimizer)
add_subdirectory(contrib/MeshQualityOptimizer)
include_directories(contrib/MeshQualityOptimizer)
set_config_option(HAVE_OPTHOM "OptHom")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/domhex AND ENABLE_DOMHEX)
add_subdirectory(contrib/domhex)
include_directories(contrib/domhex)
set_config_option(HAVE_DOMHEX "DomHex")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/QuadTri AND ENABLE_QUADTRI)
add_subdirectory(contrib/QuadTri)
include_directories(contrib/QuadTri)
set_config_option(HAVE_QUADTRI "QuadTri")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/blossom AND ENABLE_BLOSSOM)
add_subdirectory(contrib/blossom)
include_directories(contrib/blossom/MATCH contrib/blossom/concorde97
contrib/blossom/concorde97/INCLUDE)
set_config_option(HAVE_BLOSSOM "Blossom")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/nii2mesh AND ENABLE_NII2MESH)
add_subdirectory(contrib/nii2mesh)
include_directories(contrib/nii2mesh)
set_config_option(HAVE_NII2MESH "Nii2mesh")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/untangle AND ENABLE_UNTANGLE)
add_subdirectory(contrib/untangle)
include_directories(contrib/untangle)
set_config_option(HAVE_UNTANGLE "Untangle")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Netgen AND ENABLE_NETGEN)
add_subdirectory(contrib/Netgen)
include_directories(contrib/Netgen contrib/Netgen/libsrc/include
contrib/Netgen/libsrc/interface)
include_directories(contrib/Netgen contrib/Netgen/libsrc/include
contrib/Netgen/nglib)
set_config_option(HAVE_NETGEN "Netgen")
add_definitions(-DNO_PARALLEL_THREADS)
endif(ENABLE_NETGEN)
add_definitions(-DNO_PARALLEL_THREADS -DNOTCL)
endif()
if(ENABLE_BAMG)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/bamg AND ENABLE_BAMG)
add_subdirectory(contrib/bamg)
include_directories(contrib/bamg contrib/bamg/bamglib)
set_config_option(HAVE_BAMG "Bamg")
endif(ENABLE_BAMG)
if(ENABLE_MMG3D)
add_subdirectory(contrib/mmg3d)
include_directories(contrib/mmg3d/build/sources)
set_config_option(HAVE_MMG3D "Mmg3d")
endif(ENABLE_MMG3D)
if(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h)
add_subdirectory(contrib/TetgenNew)
include_directories(contrib/TetgenNew)
set_config_option(HAVE_TETGEN "Tetgen(New)")
add_definitions(-DTETLIBRARY)
message("WARNING: You are including an experimental version of Tetgen "
"that is KNOWN TO BE BUGGY on 64 bits archs and on WIN32/MSVC.")
elseif(ENABLE_TETGEN AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Tetgen/tetgen.h)
add_subdirectory(contrib/Tetgen)
include_directories(contrib/Tetgen)
set_config_option(HAVE_TETGEN "Tetgen")
add_definitions(-DTETLIBRARY)
message("WARNING: By including Tetgen you have to comply with Tetgen's "
"special licensing requirements stated in contrib/Tetgen/LICENSE.")
endif(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h)
endif(HAVE_MESH)
if(ENABLE_FOURIER_MODEL)
set(FM_REQUIRED FourierModel fftw3 gsl gslcblas)
find_all_libraries(FM_LIBS FM_REQUIRED "" lib)
if(FM_LIBS)
set_config_option(HAVE_FOURIER_MODEL "FourierModel")
list(APPEND EXTERNAL_LIBRARIES ${FM_LIBS})
endif(FM_LIBS)
endif(ENABLE_FOURIER_MODEL)
endif()
if(ENABLE_MMG)
find_library(MMG_LIB NAMES Mmg mmg)
find_path(MMG_INC "libmmg.h" PATH_SUFFIXES mmg)
if(MMG_LIB AND MMG_INC)
list(APPEND EXTERNAL_LIBRARIES ${MMG_LIB})
list(APPEND EXTERNAL_INCLUDES ${MMG_INC})
set_config_option(HAVE_MMG "Mmg")
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt AND ENABLE_HXT)
add_subdirectory(contrib/hxt)
include_directories(BEFORE ${HXT_INC_DIRS})
set_config_option(HAVE_HXT "Hxt")
# do not use arithmetic contraction in predicates.c
if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND WIN32))
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "/fp:strict")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "-fp-model strict")
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off")
else()
message(WARNING "Unknown compiler: make sure compiled functions from "
"predicates.c do not use extended double precision and follow "
"the IEEE754 standard. It is crucial for the robustness of "
"geometric predicates.")
endif()
if(MSVC)
add_definitions(/bigobj)
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/QuadMeshingTools
AND ENABLE_QUADMESHINGTOOLS)
set_config_option(HAVE_QUADMESHINGTOOLS "QuadMeshingTools")
add_subdirectory(contrib/QuadMeshingTools)
include_directories(BEFORE contrib/QuadMeshingTools)
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/WinslowUntangler
AND ENABLE_WINSLOWUNTANGLER)
set_config_option(HAVE_WINSLOWUNTANGLER "WinslowUntangler")
add_subdirectory(contrib/WinslowUntangler)
include_directories(BEFORE contrib/WinslowUntangler)
endif()
endif()
if(ENABLE_MED OR ENABLE_CGNS)
find_library(HDF5_LIB hdf5)
if(HDF5_LIB)
find_package(HDF5)
if(HDF5_FOUND)
set(HDF5_LIB "${HDF5_C_LIBRARIES}")
list(APPEND EXTERNAL_INCLUDES ${HDF5_INCLUDE_DIRS})
if(ENABLE_MED)
find_library(MED_LIB med)
if(MED_LIB)
find_library(MED_LIB medC HINTS ENV MED3HOME PATH_SUFFIXES lib)
find_path(MED_INC "med.h" HINTS ENV MED3HOME PATH_SUFFIXES include)
if(MED_LIB AND MED_INC)
set_config_option(HAVE_MED "Med")
list(APPEND EXTERNAL_LIBRARIES ${MED_LIB})
endif(MED_LIB)
endif(ENABLE_MED)
list(APPEND EXTERNAL_INCLUDES ${MED_INC})
endif()
endif()
if(ENABLE_CGNS)
find_library(CGNS_LIB cgns)
if(CGNS_LIB)
find_library(CGNS_LIB cgns HINTS ENV CGNS_ROOT PATH_SUFFIXES lib)
find_path(CGNS_INC "cgnslib.h" HINTS ENV CGNS_ROOT PATH_SUFFIXES include)
if(CGNS_LIB AND CGNS_INC)
set_config_option(HAVE_LIBCGNS "Cgns")
list(APPEND EXTERNAL_LIBRARIES ${CGNS_LIB})
endif(CGNS_LIB)
endif(ENABLE_CGNS)
list(APPEND EXTERNAL_INCLUDES ${CGNS_INC})
if(ENABLE_CGNS_CPEX0045)
set_config_option(HAVE_LIBCGNS_CPEX0045 "Cgns_CPEX0045")
endif()
endif()
endif()
if(MED_LIB OR CGNS_LIB)
list(APPEND EXTERNAL_LIBRARIES ${HDF5_LIB})
find_library(SZ_LIB szlib)
find_library(SZ_LIB NAMES szlib sz)
if(SZ_LIB)
list(APPEND EXTERNAL_LIBRARIES ${SZ_LIB})
endif(SZ_LIB)
endif()
if(NOT HAVE_LIBZ) # necessary for non-GUI builds
find_package(ZLIB)
if(ZLIB_FOUND)
set_config_option(HAVE_LIBZ "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)
endif(NOT HAVE_LIBZ)
endif(MED_LIB OR CGNS_LIB)
endif(HDF5_LIB)
endif(ENABLE_MED OR ENABLE_CGNS)
if(ENABLE_TAUCS)
if(NOT HAVE_METIS)
message(SEND_ERROR "You have to enable METIS in order to use TAUCS")
endif(NOT HAVE_METIS)
find_library(TAUCS_LIB taucs PATH_SUFFIXES lib)
if(TAUCS_LIB)
find_path(TAUCS_INC "taucs.h" PATH_SUFFIXES src include taucs)
if(TAUCS_INC)
set_config_option(HAVE_TAUCS "Taucs")
add_definitions(-DTAUCS_CILK)
list(APPEND EXTERNAL_LIBRARIES ${TAUCS_LIB})
list(APPEND EXTERNAL_INCLUDES ${TAUCS_INC})
endif(TAUCS_INC)
endif(TAUCS_LIB)
endif(ENABLE_TAUCS)
if(ENABLE_PETSC)
set(ENV_PETSC_DIR $ENV{PETSC_DIR})
set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
if(NOT ENV_PETSC_DIR)
message("WARNING: Export PETSC_DIR before calling cmake")
endif(NOT ENV_PETSC_DIR)
if(NOT ENV_PETSC_ARCH)
message("WARNING: Export PETSC_ARCH before calling cmake")
endif(NOT ENV_PETSC_ARCH)
if(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables)
set_config_option(HAVE_PETSC "PETSc")
file(STRINGS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
PETSC_VARIABLES NEWLINE_CONSUME)
# find include directories
list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/include)
list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/include)
string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES})
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
${PETSC_PACKAGES_INCLUDES})
endif()
endif()
endif()
else()
message(STATUS "HDF5 not found")
endif()
endif()
if(HAVE_SOLVER)
if(ENABLE_GMM)
find_path(GMM_INC "gmm.h" PATH_SUFFIXES src include include/gmm)
if(ENABLE_SYSTEM_CONTRIB AND GMM_INC)
message(STATUS "Using system version of GMM")
list(APPEND EXTERNAL_INCLUDES ${GMM_INC})
set_config_option(HAVE_GMM "Gmm")
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gmm/include/gmm)
include_directories(contrib/gmm/include)
set_config_option(HAVE_GMM "Gmm[contrib]")
endif()
endif()
if(ENABLE_PETSC)
if(PETSC_DIR)
set(ENV_PETSC_DIR ${PETSC_DIR})
else()
set(ENV_PETSC_DIR $ENV{PETSC_DIR})
endif()
if(PETSC_ARCH)
set(ENV_PETSC_ARCH ${PETSC_ARCH})
else()
set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
endif()
set(PETSC_POSSIBLE_CONF_FILES
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc/conf/petscvariables)
foreach(FILE ${PETSC_POSSIBLE_CONF_FILES})
if(EXISTS ${FILE})
# old-style PETSc installations (using PETSC_DIR and PETSC_ARCH)
message(STATUS "Using PETSc dir: ${ENV_PETSC_DIR}")
message(STATUS "Using PETSc arch: ${ENV_PETSC_ARCH}")
# find includes by parsing the petscvariables file
file(STRINGS ${FILE} PETSC_VARIABLES NEWLINE_CONSUME)
endif()
endforeach()
if(PETSC_VARIABLES)
# try to find PETSC_CC_INCLUDES for PETSc >= 3.4
string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES})
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "-I" "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
foreach(VAR ${PETSC_PACKAGES_INCLUDES})
list(APPEND EXTERNAL_INCLUDES ${VAR})
endforeach(VAR)
endif(PETSC_PACKAGES_INCLUDES)
endif(PETSC_PACKAGES_INCLUDES)
# find libraries (<= 3.0)
set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
find_all_libraries(PETSC_LIBS PETSC_LIBS_REQUIRED
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib "")
# petsc 3.1 creates only one library (libpetsc)
if(NOT PETSC_LIBS)
find_library(PETSC_LIBS petsc PATHS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib)
endif(NOT PETSC_LIBS)
# find slepc
if(ENABLE_SLEPC)
set(ENV_SLEPC_DIR $ENV{SLEPC_DIR})
if(NOT ENV_SLEPC_DIR)
message("WARNING: Export SLEPC_DIR before calling cmake")
endif(NOT ENV_SLEPC_DIR)
find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib)
if(SLEPC_LIB)
set_config_option(HAVE_SLEPC "SLEPc")
list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
list(APPEND EXTERNAL_INCLUDES ${ENV_SLEPC_DIR}/include)
endif(SLEPC_LIB)
endif(ENABLE_SLEPC)
list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
# find additional libraries to link with
string(REGEX MATCH "PACKAGES_LIBS = [^\n\r]*" PLIBS ${PETSC_VARIABLES})
if(PLIBS)
string(REPLACE "PACKAGES_LIBS = " "" PLIBS ${PLIBS})
string(STRIP ${PLIBS} PLIBS)
list(APPEND EXTERNAL_LIBRARIES "${PLIBS}")
endif(PLIBS)
string(REGEX MATCH "PCC_LINKER_LIBS = [^\n\r]*" LLIBS ${PETSC_VARIABLES})
if(LLIBS)
string(REPLACE "PCC_LINKER_LIBS = " "" LLIBS ${LLIBS})
string(STRIP ${LLIBS} LLIBS)
list(APPEND EXTERNAL_LIBRARIES "${LLIBS}")
endif(LLIBS)
endif(EXISTS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables)
endif(ENABLE_PETSC)
string(REPLACE "PETSC_CC_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
${PETSC_PACKAGES_INCLUDES})
else()
# try to find PETSC_PACKAGES_INCLUDES in older versions
list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/include)
list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/include)
string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES})
string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
${PETSC_PACKAGES_INCLUDES})
endif()
if(PETSC_PACKAGES_INCLUDES)
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "-I" "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
foreach(VAR ${PETSC_PACKAGES_INCLUDES})
# seem to include unexisting directories (/usr/include/lib64)
# check to avoid warnings
if(EXISTS ${VAR})
list(APPEND EXTERNAL_INCLUDES ${VAR})
endif()
endforeach()
endif()
endif()
# find libraries (<= 3.0)
set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
find_all_libraries(PETSC_LIBS PETSC_LIBS_REQUIRED
${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib "")
# petsc 3.1 creates only one library (libpetsc)
if(NOT PETSC_LIBS)
find_library(PETSC_LIBS petsc PATHS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib
NO_DEFAULT_PATH)
endif()
if(PETSC_LIBS)
set_config_option(HAVE_PETSC "PETSc")
if(NOT HAVE_BLAS)
set_config_option(HAVE_BLAS "Blas[petsc]")
endif()
if(NOT HAVE_LAPACK)
set_config_option(HAVE_LAPACK "Lapack[petsc]")
endif()
endif()
# find slepc (needs to be linked in before petsc)
if(ENABLE_SLEPC)
if(SLEPC_DIR)
set(ENV_SLEPC_DIR ${SLEPC_DIR})
else()
set(ENV_SLEPC_DIR $ENV{SLEPC_DIR})
endif()
find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib
NO_DEFAULT_PATH)
if(SLEPC_LIB)
find_path(SLEPC_INC "slepc.h" PATHS ${ENV_SLEPC_DIR} PATH_SUFFIXES include
${ENV_PETSC_ARCH}/include include/slepc NO_DEFAULT_PATH)
if(SLEPC_INC)
message(STATUS "Using SLEPc dir: ${ENV_SLEPC_DIR}")
set_config_option(HAVE_SLEPC "SLEPc")
list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
find_path(SLEPC_INC2 "slepcconf.h" PATHS ${ENV_SLEPC_DIR}
PATH_SUFFIXES ${ENV_PETSC_ARCH}/include NO_DEFAULT_PATH)
if(SLEPC_INC2)
list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC2})
endif()
endif()
endif()
endif()
list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
# find additional libraries to link with
string(REGEX MATCH "PACKAGES_LIBS = [^\n\r]*" PLIBS ${PETSC_VARIABLES})
if(PLIBS)
string(REPLACE "PACKAGES_LIBS = " "" PLIBS ${PLIBS})
string(STRIP ${PLIBS} PLIBS)
list(APPEND EXTERNAL_LIBRARIES "${PLIBS}")
endif()
string(REGEX MATCH "PETSC_EXTERNAL_LIB_BASIC = [^\n\r]*" PLIBS_BASIC ${PETSC_VARIABLES})
if(PLIBS_BASIC)
string(REPLACE "PETSC_EXTERNAL_LIB_BASIC = " "" PLIBS_BASIC ${PLIBS_BASIC})
string(STRIP ${PLIBS_BASIC} PLIBS_BASIC)
separate_arguments(PLIBS_BASIC)
list(APPEND EXTERNAL_LIBRARIES "${PLIBS_BASIC}")
endif()
string(REGEX MATCH "PCC_LINKER_LIBS = [^\n\r]*" LLIBS ${PETSC_VARIABLES})
if(LLIBS)
string(REPLACE "PCC_LINKER_LIBS = " "" LLIBS ${LLIBS})
string(STRIP ${LLIBS} LLIBS)
list(APPEND EXTERNAL_LIBRARIES "${LLIBS}")
endif()
else()
# new-style PETSc installations (in standard system directories)
find_library(PETSC_LIBS petsc)
find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc)
if(PETSC_LIBS AND PETSC_INC)
set_config_option(HAVE_PETSC "PETSc")
if(ENABLE_SLEPC)
find_library(SLEPC_LIB slepc)
find_path(SLEPC_INC "slepc.h" PATH_SUFFIXES include/slepc)
if(SLEPC_LIB AND SLEPC_INC)
set_config_option(HAVE_SLEPC "SLEPc")
list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
endif()
endif()
list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${PETSC_INC})
endif()
endif()
endif()
if(ENABLE_MUMPS AND HAVE_BLAS AND HAVE_LAPACK)
set(MUMPS_LIBS_REQUIRED smumps dmumps cmumps zmumps mumps_common pord)
if(NOT ENABLE_MPI)
list(APPEND MUMPS_LIBS_REQUIRED mpiseq)
endif()
find_all_libraries(MUMPS_LIBRARIES MUMPS_LIBS_REQUIRED "" "lib")
find_path(SMUMPS_INC "smumps_c.h" PATH_SUFFIXES src include)
find_path(DMUMPS_INC "dmumps_c.h" PATH_SUFFIXES src include)
find_path(CMUMPS_INC "cmumps_c.h" PATH_SUFFIXES src include)
find_path(ZMUMPS_INC "zmumps_c.h" PATH_SUFFIXES src include)
if(MUMPS_LIBRARIES AND SMUMPS_INC AND DMUMPS_INC AND CMUMPS_INC AND ZMUMPS_INC)
set_config_option(HAVE_MUMPS "MUMPS")
list(APPEND EXTERNAL_LIBRARIES ${MUMPS_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${SMUMPS_INC})
list(APPEND EXTERNAL_INCLUDES ${DMUMPS_INC})
list(APPEND EXTERNAL_INCLUDES ${CMUMPS_INC})
list(APPEND EXTERNAL_INCLUDES ${ZMUMPS_INC})
find_library(GFORTRAN_LIB gfortran)
if(GFORTRAN_LIB)
list(APPEND EXTERNAL_LIBRARIES ${GFORTRAN_LIB})
endif()
if(ENABLE_GMM) # use GMM/MUMPS interface
add_definitions(-DGMM_USES_MUMPS)
endif()
endif()
endif()
if(ENABLE_GETDP)
find_library(GETDP_LIB GetDP)
find_path(GETDP_INC "GetDP.h" PATH_SUFFIXES getdp)
if(GETDP_LIB AND GETDP_INC)
set_config_option(HAVE_GETDP "GetDP")
list(APPEND EXTERNAL_LIBRARIES ${GETDP_LIB})
list(APPEND EXTERNAL_INCLUDES ${GETDP_INC})
endif()
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/pro AND ENABLE_PRO)
add_subdirectory(pro)
endif()
if(ENABLE_OCC)
set(OCC_MINIMAL_VERSION "6.9.1")
if(WIN32)
set(OCC_SYS_NAME win32)
else(WIN32)
if(HAVE_64BIT_SIZE_T)
set(OCC_SYS_NAME win64)
else()
set(OCC_SYS_NAME win32)
endif()
else()
set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
endif(WIN32)
set(OCC_LIBS_REQUIRED
# subset of DataExchange
TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
# ModelingAlgorithms
TKOffset TKFeat TKFillet TKBool TKShHealing TKMesh TKHLR TKBO TKPrim
TKTopAlgo TKGeomAlgo
# ModelingData
TKBRep TKGeomBase TKG3d TKG2d
# FoundationClasses
TKAdvTools TKMath TKernel)
list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
set(OCC_LIBS)
foreach(OCC ${OCC_LIBS_REQUIRED})
find_library(OCC_LIB ${OCC} PATHS ENV CASROOT PATH_SUFFIXES lib
${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
if(OCC_LIB)
list(APPEND OCC_LIBS ${OCC_LIB})
else(OCC_LIB)
message(STATUS "OCC lib " ${OCC} " not Found")
endif(OCC_LIB)
set(OCC_LIB OCC_LIB-NOTFOUND CACHE INTERNAL "")
# unset(OCC_LIB CACHE) # cleaner, but only available in cmake >= 2.6.4
endforeach(OCC)
list(LENGTH OCC_LIBS NUM_OCC_LIBS)
endif()
find_path(OCC_INC "Standard_Version.hxx" HINTS ENV CASROOT PATH_SUFFIXES
inc include include/oce opencascade include/opencascade
occt include/occt)
if(OCC_INC)
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*")
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*")
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*")
if(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT)
string(REGEX MATCH "[0-9]+" OCC_MAJOR "${OCC_MAJOR}")
string(REGEX MATCH "[0-9]+" OCC_MINOR "${OCC_MINOR}")
string(REGEX MATCH "[0-9]+" OCC_MAINT "${OCC_MAINT}")
set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}")
endif()
endif()
if(OCC_VERSION AND OCC_VERSION VERSION_LESS ${OCC_MINIMAL_VERSION})
message(WARNING "Gmsh requires OpenCASCADE >= ${OCC_MINIMAL_VERSION}. "
"Use CMAKE_PREFIX_PATH or the CASROOT environment variable "
"to explicitly specify the installation path of OpenCASCADE")
elseif(OCC_INC)
if(OCC_VERSION AND OCC_VERSION VERSION_GREATER_EQUAL "7.8.0")
set(OCC_LIBS_REQUIRED
# subset of DataExchange
TKDESTEP TKDEIGES TKXSBase
# ModelingAlgorithms
TKOffset TKFeat TKFillet TKBool TKMesh TKHLR TKBO TKPrim TKShHealing
TKTopAlgo TKGeomAlgo
# ModelingData
TKBRep TKGeomBase TKG3d TKG2d
# FoundationClasses
TKMath TKernel)
else()
set(OCC_LIBS_REQUIRED
# subset of DataExchange
TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
# ModelingAlgorithms
TKOffset TKFeat TKFillet TKBool TKMesh TKHLR TKBO TKPrim TKShHealing
TKTopAlgo TKGeomAlgo
# ModelingData
TKBRep TKGeomBase TKG3d TKG2d
# FoundationClasses
TKMath TKernel)
endif()
if(ENABLE_OCC_TBB)
list(APPEND OCC_LIBS_REQUIRED tbb tbbmalloc)
endif()
list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
if(OCC_LIBS)
message(STATUS "OCC libraries specified explicitly: " ${OCC_LIBS})
list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS)
else()
set(OCC_LIBS)
foreach(OCC ${OCC_LIBS_REQUIRED})
find_library(OCC_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
lib ${OCC_SYS_NAME}/vc8/lib ${OCC_SYS_NAME}/vc9/lib
${OCC_SYS_NAME}/vc10/lib ${OCC_SYS_NAME}/vc11/lib
${OCC_SYS_NAME}/vc12/lib ${OCC_SYS_NAME}/vc14/lib
${OCC_SYS_NAME}/gcc/lib ${OCC_SYS_NAME}/gcc/bin
${OCC_SYS_NAME}/lib)
if(OCC_LIB)
list(APPEND OCC_LIBS ${OCC_LIB})
else()
message(STATUS "OCC lib " ${OCC} " not Found")
endif()
unset(OCC_LIB CACHE)
endforeach()
list(LENGTH OCC_LIBS NUM_OCC_LIBS)
endif()
endif()
# additional OCC libraries to handle reading of STEP/IGES attributes. Oh my...
if(ENABLE_OCC_CAF)
find_package(Freetype)
if(FREETYPE_FOUND)
if(OCC_VERSION AND OCC_VERSION VERSION_GREATER_EQUAL "7.8.0")
set(OCC_CAF_LIBS_REQUIRED
TKXCAF TKLCAF TKVCAF TKCAF TKV3d TKService TKCDF)
else()
set(OCC_CAF_LIBS_REQUIRED
TKXDESTEP TKXDEIGES TKXCAF TKLCAF TKVCAF TKCAF TKV3d TKService TKCDF)
endif()
list(LENGTH OCC_CAF_LIBS_REQUIRED NUM_OCC_CAF_LIBS_REQUIRED)
set(OCC_CAF_LIBS)
foreach(OCC ${OCC_CAF_LIBS_REQUIRED})
find_library(OCC_CAF_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
lib ${OCC_SYS_NAME}/vc8/lib ${OCC_SYS_NAME}/vc9/lib
${OCC_SYS_NAME}/vc10/lib ${OCC_SYS_NAME}/vc11/lib
${OCC_SYS_NAME}/vc12/lib ${OCC_SYS_NAME}/vc14/lib
${OCC_SYS_NAME}/gcc/lib ${OCC_SYS_NAME}/gcc/bin
${OCC_SYS_NAME}/lib)
if(OCC_CAF_LIB)
list(APPEND OCC_CAF_LIBS ${OCC_CAF_LIB})
else()
message(STATUS "OCC CAF lib " ${OCC} " not Found")
endif()
unset(OCC_CAF_LIB CACHE)
endforeach()
list(LENGTH OCC_CAF_LIBS NUM_OCC_CAF_LIBS)
endif()
endif()
if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
find_path(OCC_INC "BRep_Tool.hxx" PATHS ENV CASROOT PATH_SUFFIXES inc
include opencascade)
if(OCC_INC)
set_config_option(HAVE_OCC "OpenCascade")
list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
if(HAVE_64BIT_SIZE_T)
add_definitions(-D_OCC64)
endif(HAVE_64BIT_SIZE_T)
if(CYGWIN)
list(APPEND EXTERNAL_LIBRARIES "winspool")
elseif(MSVC)
add_definitions(-DWNT)
endif(CYGWIN)
find_path(OCC_CONFIG_H "config.h" PATHS ${OCC_INC} ${OCC_CONFIG_H_PATH}
NO_DEFAULT_PATH)
if(NOT OCC_CONFIG_H)
add_definitions(-DHAVE_NO_OCC_CONFIG_H)
endif(NOT OCC_CONFIG_H)
endif(OCC_INC)
endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
if(HAVE_OCC AND ENABLE_SALOME)
add_subdirectory(contrib/Salome)
include_directories(contrib/Salome)
add_definitions(-DOCCGEOMETRY)
set_config_option(HAVE_SALOME "Salome")
endif(HAVE_OCC AND ENABLE_SALOME)
endif(ENABLE_OCC)
if(ENABLE_ACIS)
find_library(ACIS_LIB SpaACIS PATH_SUFFIXES bin/maci386)
if(ACIS_LIB)
find_path(ACIS_INC "kernapi.hxx" PATH_SUFFIXES include)
if(ACIS_INC)
set_config_option(HAVE_ACIS "Acis")
list(APPEND EXTERNAL_LIBRARIES ${ACIS_LIB})
list(APPEND EXTERNAL_INCLUDES ${ACIS_INC})
endif(ACIS_INC)
endif(ACIS_LIB)
endif(ENABLE_ACIS)
if(ENABLE_MATCH)
find_library(MATCH_LIB blossom PATH_SUFFIXES lib)
find_library(CONCORDE_LIB concorde PATH_SUFFIXES lib)
if(MATCH_LIB AND CONCORDE_LIB)
find_path(CONCORDE_INC "concorde.h" PATH_SUFFIXES concorde97)
find_path(MATCH_INC "match.h" PATH_SUFFIXES MATCH)
if(MATCH_INC AND CONCORDE_INC)
set_config_option(HAVE_MATCH "Match")
list(APPEND EXTERNAL_LIBRARIES ${MATCH_LIB} ${CONCORDE_LIB})
list(APPEND EXTERNAL_INCLUDES ${MATCH_INC} ${CONCORDE_INC})
endif(MATCH_INC AND CONCORDE_INC)
endif(MATCH_LIB AND CONCORDE_LIB)
endif(ENABLE_MATCH)
if(ENABLE_OSMESA)
find_library(OSMESA_LIB OSMesa)
if(OSMESA_LIB)
set_config_option(HAVE_OSMESA "OSMesa")
list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB})
endif(OSMESA_LIB)
endif(ENABLE_OSMESA)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
if(NOT HAVE_VSNPRINTF)
# append OCC CAF libraries first...
if(NUM_OCC_CAF_LIBS EQUAL NUM_OCC_CAF_LIBS_REQUIRED)
set_config_option(HAVE_OCC_CAF "OpenCASCADE-CAF")
list(APPEND EXTERNAL_LIBRARIES ${OCC_CAF_LIBS} ${FREETYPE_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${FREETYPE_INCLUDE_DIRS})
if(WIN32)
list(APPEND EXTERNAL_LIBRARIES "windowscodecs")
list(APPEND EXTERNAL_LIBRARIES "ole32")
endif()
endif()
# then append OCC libraries
set_config_option(HAVE_OCC "OpenCASCADE")
list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
if(WIN32 AND NOT MSVC)
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()
if(WIN32 AND MSVC)
add_definitions(-D "Standard_EXPORT=__declspec(dllimport)")
endif()
endif()
endif()
if(ENABLE_ZIPPER)
if(ENABLE_BUILD_IOS)
set_config_option(HAVE_LIBZ "Zlib")
endif()
if(NOT HAVE_LIBZ) # necessary for non-GUI builds
find_package(ZLIB)
if(ZLIB_FOUND)
set_config_option(HAVE_LIBZ "Zlib")
list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zipper AND HAVE_LIBZ)
add_subdirectory(contrib/zipper)
include_directories(contrib/zipper)
set_config_option(HAVE_ZIPPER "Zipper")
endif()
endif()
if(ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
find_package(PythonLibs)
if(SWIG_FOUND AND PYTHONLIBS_FOUND)
message(STATUS "Found SWIG version " ${SWIG_VERSION})
find_package(PythonInterp)
string(SUBSTRING ${SWIG_VERSION} 0 1 SWIG_MAJOR_VERSION)
if(SWIG_MAJOR_VERSION EQUAL 1)
message(WARNING "Python bindings require SWIG >= 2: disabling Python")
else()
set_config_option(HAVE_PYTHON "Python")
mark_as_advanced(CLEAR PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
if(ENABLE_NUMPY)
if (NOT NUMPY_INC)
EXEC_PROGRAM (${PYTHON_EXECUTABLE}
ARGS "-c \"import numpy; print(numpy.get_include())\""
OUTPUT_VARIABLE NUMPY_INC
RETURN_VALUE NUMPY_NOT_FOUND)
endif()
if(NUMPY_INC)
list(APPEND EXTERNAL_INCLUDES ${NUMPY_INC})
set_config_option(HAVE_NUMPY "Numpy")
endif()
endif()
if(HAVE_PETSC)
if(ENABLE_PETSC4PY)
EXECUTE_PROCESS(
COMMAND ${PYTHON_EXECUTABLE} -c "import petsc4py; print(petsc4py.get_include())"
OUTPUT_VARIABLE PETSC4PY_INC
RESULT_VARIABLE PETSC4PY_NOT_FOUND
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(PETSC4PY_INC)
list(APPEND EXTERNAL_INCLUDES ${PETSC4PY_INC})
set_config_option(HAVE_PETSC4PY "PETSc4py")
endif()
endif()
endif()
endif()
endif()
endif()
check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
if(NOT HAVE_VSNPRINTF AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
set_config_option(HAVE_NO_VSNPRINTF "NoVsnprintf")
endif(NOT HAVE_VSNPRINTF)
endif()
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
if(HAVE_SYS_SOCKET_H)
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
endif(HAVE_SYS_SOCKET_H)
endif()
check_type_size(socklen_t SOCKLEN_T_SIZE)
if(NOT SOCKLEN_T_SIZE)
set(CMAKE_EXTRA_INCLUDE_FILES)
if(NOT SOCKLEN_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
set_config_option(HAVE_NO_SOCKLEN_T "NoSocklenT")
endif(NOT SOCKLEN_T_SIZE)
endif()
check_include_file(stdint.h HAVE_STDINT_H)
if(HAVE_STDINT_H)
set(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
else()
set_config_option(HAVE_NO_STDINT_H "NoStdintH")
endif()
check_type_size(intptr_t INTPTR_T_SIZE)
set(CMAKE_EXTRA_INCLUDE_FILES)
if(NOT INTPTR_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
set_config_option(HAVE_NO_INTPTR_T "NoIntptrT")
endif()
check_include_file(dlfcn.h DLFCN_H)
if(DLFCN_H)
set_config_option(HAVE_DLOPEN "Dlopen")
list(APPEND EXTERNAL_LIBRARIES ${CMAKE_DL_LIBS})
endif(DLFCN_H)
endif()
if(UNIX)
# do not optimize some files on Unix
file(GLOB_RECURSE NON_OPTIMIZED_SRC Common/GmshPredicates.cpp Mesh/BDS.cpp
Parser/Gmsh.tab.cpp contrib/Tetgen*/*.cxx)
set_source_files_properties(${NON_OPTIMIZED_SRC} COMPILE_FLAGS "-O0")
endif(UNIX)
if(MSVC)
add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX
-D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
set(GMSH_SRC ${GMSH_SRC};Fltk/Win32Icon.rc)
endif(MSVC)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
check_include_file(linux/joystick.h LINUX_JOYSTICK_H)
if(LINUX_JOYSTICK_H)
set_config_option(HAVE_LINUX_JOYSTICK "LinuxJoystick")
endif()
endif()
if(WIN32)
list(APPEND EXTERNAL_LIBRARIES wsock32 ws2_32)
endif(WIN32)
add_definitions(-D_USE_MATH_DEFINES)
list(APPEND EXTERNAL_LIBRARIES winmm wsock32 ws2_32 psapi)
endif()
if(MSVC)
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_DEPRECATE)
endif()
# add C functions API
set(GMSH_SRC ${GMSH_SRC};api/gmshc.cpp)
# force full warnings to encourage everybody to write clean(er) code
check_cxx_compiler_flag("-Wall" WALL)
if(WALL AND NOT MSVC)
file(GLOB_RECURSE WALL_SRC src/common/*.cpp src/fltk/*.cpp FunctionSpace/*.cpp
src/geo/*.cpp src/graphics/*.cpp src/mesh/*.cpp src/numeric/*.cpp src/parser/*.cpp
src/plugin/*.cpp src/post/*.cpp src/solver/*.cpp)
set(WF "-Wall")
check_cxx_compiler_flag("-Wint-to-void-pointer-cast" WCAST)
if(WCAST)
set(WF "${WF} -Wno-int-to-void-pointer-cast")
endif()
check_cxx_compiler_flag("-Wdeprecated-declarations" WDEPREC)
if(WDEPREC)
# FIXME: remove this when we have fixed the deprecated GLU code for OpenGL3
set(WF "${WF} -Wno-deprecated-declarations")
endif()
check_cxx_compiler_flag("-Wmisleading-indentation" WIND)
if(WIND)
set(WF "${WF} -Wno-misleading-indentation")
endif()
check_cxx_compiler_flag("-Wno-attributes" WATTR)
if(WATTR)
# FIXME: remove this when GCC behaves more intelligently
set(WF "${WF} -Wno-attributes")
endif()
check_cxx_compiler_flag("-Wno-unused-but-set-variable" WUNUSED)
if(WUNUSED)
set(WF "${WF} -Wno-unused-but-set-variable")
endif()
if(WIN32 OR NOT HAVE_64BIT_SIZE_T)
# FIXME: remove printf family warnings on 32 bit systems and windows
check_cxx_compiler_flag("-Wno-format" WFORMAT)
if(WFORMAT)
set(WF "${WF} -Wno-format")
endif()
endif()
set_compile_flags(WALL_SRC ${WF})
endif()
# don't issue warnings for contributed libraries and for autogenerated files
check_cxx_compiler_flag("-w" NOWARN)
if(NOWARN)
file(GLOB_RECURSE NOWARN_SRC contrib/*.cpp contrib/*.cc contrib/*.cxx
contrib/*.c src/parser/Gmsh.*.cpp)
set_compile_flags(NOWARN_SRC "-w")
endif()
# fine-tune optimization flags for particular files
check_cxx_compiler_flag("-O0" NOOPT)
if(NOOPT OR ENABLE_BUILD_IOS)
if(ENABLE_BUILD_IOS)
# optimized builds on iOS 10 64 bits fail spectacularly
file(GLOB_RECURSE NOOPT_SRC src/geo/G*.cpp src/mesh/BDS.cpp
src/parser/Gmsh.tab.cpp contrib/blossom/* contrib/bamg/*
src/mesh/Background*)
else()
# bamg fails even with -O1
file(GLOB_RECURSE NOOPT_SRC contrib/bamg/*)
endif()
set_compile_flags(NOOPT_SRC "-O0")
endif()
if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND WIN32))
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/src/numeric/robustPredicates.cpp"
PROPERTIES COMPILE_FLAGS "/fp:strict")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/src/numeric/robustPredicates.cpp"
PROPERTIES COMPILE_FLAGS "-fp-model strict")
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/src/numeric/robustPredicates.cpp"
PROPERTIES COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off")
else()
message(WARNING "Unknown compiler: make sure compiled functions from "
"src/numeric/robustPredicates.cpp do not use extended double precision "
"and follow the IEEE754 standard. It is crucial for the robustness of "
"geometric predicates.")
endif()
# enable Revoropt and set compile flags for the corresponding plugin
if(ENABLE_REVOROPT)
if(HAVE_EIGEN AND HAVE_MESH AND HAVE_PLUGINS AND HAVE_ANN AND HAVE_ALGLIB)
list(APPEND EXTERNAL_INCLUDES contrib/Revoropt/include)
set_config_option(HAVE_REVOROPT "Revoropt")
add_definitions(-DUSE_ANN)
else()
message(WARNING "Revoropt requires Eigen, Mesh, Plugins, ANN and ALGLIB")
endif()
endif()
if(HAVE_MESH AND NOT HAVE_EIGEN AND NOT HAVE_LAPACK)
message(WARNING "Most meshing algorithms will not be functional without "
"Eigen or Lapack")
endif()
list(SORT CONFIG_OPTIONS)
set(GMSH_CONFIG_OPTIONS "")
foreach(OPT ${CONFIG_OPTIONS})
set(GMSH_CONFIG_OPTIONS "${GMSH_CONFIG_OPTIONS} ${OPT}")
endforeach(OPT)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h)
# process cmake environment variables so we can append them to the -I
# include commands. This is not recommended (we should only use the
# cache variables) but it is very convenient: otherwise we have to
# remember providing the -D... options to cmake for each new build.
endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/common/GmshConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/src/common/GmshConfig.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/common/GmshVersion.h.in
${CMAKE_CURRENT_BINARY_DIR}/src/common/GmshVersion.h)
# the texi version file is modified in the source directory (not
# ideal for version.texi, but since git tracks the contents of the file this is
# acceptable as it will only change when the actual version is changed - not for
# each git hash)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi.in
${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi)
if(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
if (GMSH_RELEASE)
set(GMSH_PYTHON_VERSION ${GMSH_SHORT_VERSION})
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/README.gmsh.rst GMSH_LONG_DESCRIPTION)
else()
if ("${GMSH_EXTRA_VERSION}" MATCHES "-nox")
set(GMSH_PYTHON_VERSION "${GMSH_SHORT_VERSION}.dev1+nox")
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/README.gmsh-nox-dev.rst GMSH_LONG_DESCRIPTION)
else ()
set(GMSH_PYTHON_VERSION "${GMSH_SHORT_VERSION}.dev1")
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/README.gmsh-dev.rst GMSH_LONG_DESCRIPTION)
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/METADATA.in ${CMAKE_CURRENT_BINARY_DIR}/METADATA)
endif()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.txt ${GMSH_SHORT_VERSION})
# process cmake environment variables so we can append them to the -I include
# commands. This is not recommended (we should only use the cache variables) but
# it is very convenient: otherwise we have to remember providing the
# -D... options to cmake for each new build.
set(ENV_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
set(ENV_CMAKE_INCLUDE_PATH $ENV{CMAKE_INCLUDE_PATH})
if(UNIX)
if(ENV_CMAKE_PREFIX_PATH)
string(REPLACE ":" ";" ENV_CMAKE_PREFIX_PATH ${ENV_CMAKE_PREFIX_PATH})
endif(ENV_CMAKE_PREFIX_PATH)
endif()
if(ENV_CMAKE_INCLUDE_PATH)
string(REPLACE ":" ";" ENV_CMAKE_INCLUDE_PATH ${ENV_CMAKE_INCLUDE_PATH})
endif(ENV_CMAKE_INCLUDE_PATH)
endif(UNIX)
endif()
endif()
list(APPEND EXTERNAL_INCLUDES ${CMAKE_INCLUDE_PATH} ${ENV_CMAKE_INCLUDE_PATH})
list(APPEND EXTERNAL_INCLUDES ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
foreach(DIR ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
list(APPEND EXTERNAL_INCLUDES ${DIR}/include)
endforeach(DIR)
endforeach()
if(EXTERNAL_INCLUDES)
list(REMOVE_DUPLICATES EXTERNAL_INCLUDES)
endif(EXTERNAL_INCLUDES)
endif()
if(HAVE_FLTK)
set(LINK_LIBRARIES ${FLTK_LIBRARIES} ${EXTERNAL_LIBRARIES}
${OPENGL_LIBRARIES} ${LAPACK_LIBRARIES})
elseif(HAVE_QT)
set(LINK_LIBRARIES ${QT_LIBRARIES} ${EXTERNAL_LIBRARIES}
set(LINK_LIBRARIES ${FLTK_LIBRARIES} ${EXTERNAL_LIBRARIES}
${OPENGL_LIBRARIES} ${LAPACK_LIBRARIES})
elseif(HAVE_OPENGL)
set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${OPENGL_LIBRARIES}
${LAPACK_LIBRARIES})
else(HAVE_FLTK)
else()
set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
endif(HAVE_FLTK)
endif()
# try to use static gfortran on static builds (cannot do this on dynamic builds
# as e.g. Debian compiles libgfortran.a without -fPIC: sigh...)
if(NOT ENABLE_BUILD_DYNAMIC AND NOT ENABLE_BUILD_SHARED)
find_library(GFORTRAN_STATIC libgfortran.a)
if(GFORTRAN_STATIC)
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES)
message(STATUS "Using static libgfortran")
foreach(STR ${LINK_LIBRARIES})
string(REPLACE "-lgfortran" ${GFORTRAN_STATIC} STR2 ${STR})
list(APPEND LINK_LIBRARIES2 ${STR2})
endforeach()
set(LINK_LIBRARIES ${LINK_LIBRARIES2})
endif()
endif()
# Linux-specific linker options
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(HAVE_OCC)
find_library(RT_LIB rt)
if(RT_LIB)
list(APPEND LINK_LIBRARIES ${RT_LIB})
endif()
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
add_definitions(-fPIC)
endif()
endif()
# we could specify include dirs more selectively, but this is simpler
include_directories(Common Fltk Geo Graphics Mesh Solver Numeric Parser
Plugin Post Qt ${EXTERNAL_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/Common)
include_directories(src/common src/fltk src/geo src/graphics src/mesh src/solver
src/numeric src/parser src/plugin src/post api
${EXTERNAL_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/src/common)
# set this for external codes that might include this CMakeList file
set(GMSH_EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDES} CACHE
STRING "External include directories")
set(GMSH_EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} CACHE
STRING "External libraries")
set(GMSH_EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDES} CACHE
STRING "External include directories" FORCE)
set(GMSH_EXTERNAL_LIBRARIES ${LINK_LIBRARIES} CACHE
STRING "External libraries" FORCE)
# group sources for easier navigation in IDEs
foreach(DIR ${GMSH_DIRS})
string(REGEX REPLACE "\\+" "\\\\+" DIR ${DIR})
source_group(${DIR} REGULAR_EXPRESSION ${DIR}/.*)
endforeach(DIR)
# static library target: we don't build it by default (we could then
# create the gmsh target by linking with it) because doing so slows
# down the compile/link development a lot: running ranlib+ar on a
# large static lib every time we recompile is frustratingly
# slow. Instead, we build the gmsh target directly from the object
# files. This is much faster but has one side effect: when we actually
# want to build the lib we need to recompile everything (the first
# time--it's a separate target)
add_library(lib STATIC EXCLUDE_FROM_ALL ${GMSH_SRC})
set_target_properties(lib PROPERTIES OUTPUT_NAME Gmsh)
if(MSVC)
set_target_properties(lib PROPERTIES DEBUG_POSTFIX d)
if(ENABLE_MSVC_STATIC_RUNTIME)
set_target_properties(lib PROPERTIES LINK_FLAGS_RELEASE "/nodefaultlib:LIBCMT")
endif(ENABLE_MSVC_STATIC_RUNTIME)
endif(MSVC)
# shared library target: we don't build it by default either
add_library(shared SHARED EXCLUDE_FROM_ALL ${GMSH_SRC})
set_target_properties(shared PROPERTIES OUTPUT_NAME Gmsh)
if(HAVE_LAPACK AND LAPACK_FLAGS)
set_target_properties(shared PROPERTIES LINK_FLAGS ${LAPACK_FLAGS})
endif(HAVE_LAPACK AND LAPACK_FLAGS)
if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
message("WARNING: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library wont link. "
"Change in msvc /MT flag to /MD in the shared project properties")
endif(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
target_link_libraries(shared ${LINK_LIBRARIES})
endforeach()
# static library target
if(ENABLE_BUILD_LIB)
add_library(lib STATIC ${GMSH_SRC})
set_target_properties(lib PROPERTIES OUTPUT_NAME gmsh)
if(MSVC)
set_target_properties(lib PROPERTIES DEBUG_POSTFIX d)
if(ENABLE_MSVC_STATIC_RUNTIME)
set_target_properties(lib PROPERTIES LINK_FLAGS_RELEASE "/nodefaultlib:LIBCMT")
endif()
endif()
endif()
# shared library target
if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
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)
set_target_properties(shared PROPERTIES PREFIX "" IMPORT_PREFIX ""
IMPORT_SUFFIX ".lib" COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
if(NOT ENABLE_PRIVATE_API)
# hide all symbols by default (if not exporting the private API); symbols to
# export should be marked with __attribute__ ((visibility("default")))
set_target_properties(shared PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
endif()
# hide all symbols from static libs linked into the shared Gmsh lib (this is
# easier than recompiling all the dependencies with -fvisibility=hidden)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# TODO would be nice to have the equivalent on macOS
message(STATUS "Excluding symbols from bundled static libraries")
list(APPEND LINK_LIBRARIES "-Wl,--exclude-libs,ALL")
endif()
endif()
target_link_libraries(shared ${LINK_LIBRARIES})
# don't define LC_RPATH in dylib for development, to not get endless warnings
# about code signing
if(APPLE AND NOT GMSH_RELEASE)
set_target_properties(shared PROPERTIES INSTALL_RPATH "")
endif()
if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
message(STATUS "Note: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library "
"won't link. In MSVC change /MT to /MD in the shared project properties")
endif()
endif()
# binary targets
if(HAVE_FLTK)
add_executable(gmsh WIN32 Fltk/Main.cpp ${GMSH_SRC})
add_executable(gmsh_dynamic EXCLUDE_FROM_ALL Fltk/Main.cpp)
target_link_libraries(gmsh_dynamic shared)
elseif(HAVE_QT)
qt4_wrap_cpp(GMSH_MOC_SRC ${GMSH_MOC_HDR})
add_executable(gmsh WIN32 Qt/Main.cpp ${GMSH_SRC} ${GMSH_MOC_SRC})
else(HAVE_FLTK)
add_executable(gmsh Common/Main.cpp ${GMSH_SRC})
endif(HAVE_FLTK)
if(ENABLE_BUILD_DYNAMIC)
add_executable(gmsh WIN32 src/common/Main.cpp)
target_link_libraries(gmsh shared)
else()
add_executable(gmsh WIN32 src/common/Main.cpp ${GMSH_SRC})
endif()
# we could add this to create a minimal app bundle even without install
# if(APPLE AND NOT ENABLE_OS_SPECIFIC_INSTALL)
# set_target_properties(gmsh PROPERTIES MACOSX_BUNDLE ON
# MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_dev.plist)
# endif()
else()
if(ENABLE_BUILD_DYNAMIC)
add_executable(gmsh src/common/Main.cpp)
target_link_libraries(gmsh shared)
else()
add_executable(gmsh src/common/Main.cpp ${GMSH_SRC})
endif()
endif()
target_link_libraries(gmsh ${LINK_LIBRARIES})
# increase stack to 16Mb on Windows to avoid overflows in recursive
# tet classification for large 3D Delaunay grids + force static
# linking of system libraries with cygwin/mingw (to ease distribution
# andspeed up app startup time)
# OS specific linker options
if(WIN32 AND NOT MSVC)
if(HAVE_64BIT_SIZE_T)
set_target_properties(gmsh PROPERTIES LINK_FLAGS
"-Wl,--stack,16777216 -mwindows -static")
else(HAVE_64BIT_SIZE_T)
set_target_properties(gmsh PROPERTIES LINK_FLAGS
"-Wl,--stack,16777216 ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res -mwindows -static")
endif(HAVE_64BIT_SIZE_T)
# remove stupid -Wl,-Bdynamic flags
set(FLAGS "-Wl,--stack,16777216 -Wl,--image-base -Wl,0x10000000 -static")
if(HAVE_FLTK)
set(APPFLAGS "${FLAGS} -municode -mwindows")
if(HAVE_64BIT_SIZE_T)
set(APPFLAGS "${APPFLAGS} \"${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/Win64Icon.res\"")
else()
set(APPFLAGS "${APPFLAGS} \"${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/Win32Icon.res\"")
endif()
else()
set(APPFLAGS "${FLAGS} -municode -mconsole")
endif()
set_target_properties(gmsh PROPERTIES LINK_FLAGS "${APPFLAGS}")
if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
set_target_properties(shared PROPERTIES LINK_FLAGS "${FLAGS}")
endif()
# remove -Wl,-Bdynamic flags
set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
elseif(MSVC)
set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216")
endif(WIN32 AND NOT MSVC)
add_subdirectory(gmshpy)
set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216 /SAFESEH:NO")
elseif(APPLE)
# this remove ld warnings with PETSc+MUMPS on recent macOS versions; but
# breaks exception handling
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-no_compact_unwind")
endif()
# android target
if(ENABLE_BUILD_ANDROID)
find_file(CMAKE_TOOLCHAIN_FILE "android.toolchain.cmake")
if(NOT CMAKE_TOOLCHAIN_FILE)
message(FATAL_ERROR "Cannot compile Gmsh for android without android-cmake")
endif()
add_definitions(-D_GLIBCXX_USE_C99_MATH=1)
set(CMAKE_BUILD_TYPE Release)
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/libs/)
add_definitions(-DBUILD_ANDROID)
add_definitions(-DPICOJSON_USE_LOCALE=0)
add_library(androidGmsh SHARED ${GMSH_SRC})
set_target_properties(androidGmsh PROPERTIES OUTPUT_NAME gmsh)
target_link_libraries(androidGmsh ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
add_custom_command(TARGET androidGmsh POST_BUILD COMMAND
${CMAKE_STRIP} ${LIBRARY_OUTPUT_PATH}/libgmsh.so)
endif()
# parser target
find_program(BISON bison)
find_program(FLEX flex)
if(BISON AND FLEX)
add_custom_target(parser
add_custom_target(parser
COMMAND ${BISON} -p gmsh_yy --output Gmsh.tab.cpp -d Gmsh.y
COMMAND ${FLEX} -P gmsh_yy -o Gmsh.yy.cpp Gmsh.l
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Parser)
endif(BISON AND FLEX)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/parser)
endif()
if(UNIX)
# cannot use cmake's file search functions here (they would only
# find files existing at configuration time)
add_custom_target(purge
# cannot use cmake's file search functions here (they would only find files
# existing at configuration time)
add_custom_target(purge
COMMAND rm -f `find . -name *~ -o -name *~~`
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(etags
add_custom_target(etags
COMMAND etags `find . -name *.cpp -o -name *.h -o -name *.y`
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif(UNIX)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND NOT
(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")))
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE CXX_COMPILER_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(CXX_COMPILER_VERSION "Unknown")
endif()
set(WELCOME_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/WELCOME.txt)
set(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/LICENSE.txt)
set(CREDITS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/CREDITS.txt)
file(GLOB TUTORIAL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/?*.*)
file(GLOB DEMO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/demos/?*.*)
set(SDK_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/SDK.txt)
set(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt)
set(CREDITS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CREDITS.txt)
set(CHANGELOG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.txt)
file(GLOB TUTORIALS_GEO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/?*.*)
file(GLOB TUTORIALS_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/c++/?*.*)
file(GLOB TUTORIALS_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/c/?*.*)
file(GLOB TUTORIALS_PY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/python/?*.*)
file(GLOB TUTORIALS_JL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/julia/?*.*)
file(GLOB TUTORIALS_F90_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorials/fortran/?*.*)
file(GLOB EXAMPLES ${CMAKE_CURRENT_SOURCE_DIR}/examples/*)
foreach(SUBDIR ${EXAMPLES})
if(IS_DIRECTORY ${SUBDIR})
list(APPEND EXAMPLES_DIRS ${SUBDIR})
endif()
endforeach()
set(TEX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo)
file(GLOB TEX_SRC ${TEX_DIR}/*.texi)
file(GLOB TEX_IMG ${TEX_DIR}/images/*.png)
set(TEX_OBJ ${TEX_DIR}/gmsh.aux ${TEX_DIR}/gmsh.cp ${TEX_DIR}/gmsh.cps
${TEX_DIR}/gmsh.fn ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.ky
${TEX_DIR}/gmsh.log ${TEX_DIR}/gmsh.pdf ${TEX_DIR}/gmsh.pg ${TEX_DIR}/gmsh.toc
${TEX_DIR}/gmsh.fn ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.ky
${TEX_DIR}/gmsh.log ${TEX_DIR}/gmsh.pdf ${TEX_DIR}/gmsh.pg ${TEX_DIR}/gmsh.toc
${TEX_DIR}/gmsh.tp ${TEX_DIR}/gmsh.tps ${TEX_DIR}/gmsh.txt ${TEX_DIR}/gmsh.vr)
macro(unix2dos VARNAME)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unix2dos)
macro(unix2dos VARNAME UNIQUEPATH)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${UNIQUEPATH})
set(UNIX2DOS_FILES)
foreach(FILE ${${VARNAME}})
file(READ ${FILE} F0)
get_filename_component(N ${FILE} NAME)
if(CYGWIN)
string(REGEX REPLACE "\n" "\r\n" F1 "${F0}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F1}")
else(CYGWIN) # if not in cygwin, cmake adds '\r's automatically
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F0}")
endif(CYGWIN)
list(APPEND UNIX2DOS_FILES ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N})
endforeach(FILE)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${UNIQUEPATH}/${N} "${F1}")
else() # if not in Cygwin, cmake adds '\r's automatically
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${UNIQUEPATH}/${N} "${F0}")
endif()
list(APPEND UNIX2DOS_FILES ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${UNIQUEPATH}/${N})
endforeach()
set(${VARNAME} ${UNIX2DOS_FILES})
endmacro(unix2dos)
endmacro()
if(WIN32)
set(GMSH_BIN .)
set(GMSH_DOC .)
set(GMSH_MAN .)
if(ENABLE_OS_SPECIFIC_INSTALL)
set(GMSH_BIN .)
set(GMSH_LIB .)
set(GMSH_DOC .)
set(GMSH_MAN .)
set(GMSH_INC .)
else()
include(GNUInstallDirs)
set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
endif()
if(CYGWIN)
unix2dos(GMSH_API)
unix2dos(WELCOME_FILE)
unix2dos(LICENSE_FILE)
unix2dos(CREDITS_FILE)
unix2dos(TUTORIAL_FILES)
unix2dos(DEMO_FILES)
endif(CYGWIN)
elseif(APPLE)
# set these so that the files get installed nicely in the MacOSX
# .app bundle (FIXME: this screws up a standard "make install" on
# MacOS)
unix2dos(GMSH_API "api")
if(ENABLE_PRIVATE_API)
unix2dos(GMSH_PRIVATE_API "private_api")
endif()
unix2dos(WELCOME_FILE "welcome")
unix2dos(SDK_FILE "sdk")
unix2dos(LICENSE_FILE "license")
unix2dos(CREDITS_FILE "credits")
unix2dos(CHANGELOG_FILE "changelog")
unix2dos(TUTORIALS_GEO_FILES "geo")
unix2dos(TUTORIALS_CPP_FILES "cpp")
unix2dos(TUTORIALS_C_FILES "c")
unix2dos(TUTORIALS_PY_FILES "python")
unix2dos(TUTORIALS_JL_FILES "julia")
unix2dos(TUTORIALS_F90_FILES "fortran")
foreach(DIR ${EXAMPLES_DIRS})
file(GLOB EXAMPLES_FILES ${DIR}/?*.*)
unix2dos(EXAMPLES_FILES "examples")
endforeach()
endif()
elseif(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
# set these so that the files get installed nicely in the macOS .app bundle
set(GMSH_BIN ../MacOS)
set(GMSH_LIB ../MacOS)
set(GMSH_DOC ../../..)
set(GMSH_MAN ../../..)
else(WIN32)
set(GMSH_BIN bin)
set(GMSH_DOC share/doc/gmsh)
set(GMSH_MAN share/man/man1)
endif(WIN32)
set(GMSH_INC ../MacOS)
else()
include(GNUInstallDirs)
set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
endif()
# mark targets as optional so we can install them separately if needed
# (e.g. "make lib" or "make shared" followed by "make install/fast")
install(TARGETS gmsh DESTINATION ${GMSH_BIN} OPTIONAL)
install(TARGETS lib shared DESTINATION lib OPTIONAL)
install(FILES ${GMSH_API} DESTINATION include/gmsh)
if(ENABLE_BUILD_LIB)
install(TARGETS lib DESTINATION ${GMSH_LIB} OPTIONAL)
endif()
if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
install(TARGETS shared DESTINATION ${GMSH_LIB} OPTIONAL)
endif()
if(ENABLE_ONELAB AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/onelab)
install(FILES ${ONELAB_PY} DESTINATION ${GMSH_BIN})
endif()
if(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
install(FILES ${GMSH_API} DESTINATION ${GMSH_INC})
install(FILES ${GMSH_PY} DESTINATION ${GMSH_LIB})
install(FILES ${GMSH_JL} DESTINATION ${GMSH_LIB})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/METADATA DESTINATION
${GMSH_LIB}/gmsh-${GMSH_PYTHON_VERSION}.dist-info)
if(ENABLE_PRIVATE_API)
install(FILES ${GMSH_PRIVATE_API} DESTINATION ${GMSH_INC}/gmsh)
if(HAVE_CONTRIB_EIGEN) # the private API depends on Eigen
install(DIRECTORY contrib/eigen/Eigen DESTINATION ${GMSH_INC}/gmsh)
endif()
endif()
endif()
if(INSTALL_SDK_README)
configure_file(${SDK_FILE} ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README.txt DESTINATION .)
endif()
install(FILES ${WELCOME_FILE} DESTINATION ${GMSH_DOC} RENAME README.txt)
install(FILES ${LICENSE_FILE} DESTINATION ${GMSH_DOC})
install(FILES ${CREDITS_FILE} DESTINATION ${GMSH_DOC})
install(FILES ${TUTORIAL_FILES} DESTINATION ${GMSH_DOC}/tutorial)
install(FILES ${DEMO_FILES} DESTINATION ${GMSH_DOC}/demos)
install(FILES ${CHANGELOG_FILE} DESTINATION ${GMSH_DOC})
install(FILES ${TUTORIALS_GEO_FILES} DESTINATION ${GMSH_DOC}/tutorials)
install(FILES ${TUTORIALS_CPP_FILES} DESTINATION ${GMSH_DOC}/tutorials/c++)
install(FILES ${TUTORIALS_C_FILES} DESTINATION ${GMSH_DOC}/tutorials/c)
install(FILES ${TUTORIALS_PY_FILES} DESTINATION ${GMSH_DOC}/tutorials/python)
install(FILES ${TUTORIALS_JL_FILES} DESTINATION ${GMSH_DOC}/tutorials/julia)
install(FILES ${TUTORIALS_F90_FILES} DESTINATION ${GMSH_DOC}/tutorials/fortran)
foreach(DIR ${EXAMPLES_DIRS})
get_filename_component(EXAMPLES_DIR_NAME ${DIR} NAME)
file(GLOB EXAMPLES_FILES ${DIR}/?*.*)
install(FILES ${EXAMPLES_FILES} DESTINATION ${GMSH_DOC}/examples/${EXAMPLES_DIR_NAME})
endforeach()
if(UNIX AND NOT CYGWIN)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/doc/gmsh.1 DESTINATION ${GMSH_MAN})
endif(UNIX AND NOT CYGWIN)
endif()
add_custom_target(get_headers
COMMAND ${CMAKE_COMMAND} -E make_directory Headers/gmsh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
foreach(FILE ${GMSH_API})
add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
-E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endforeach()
if(ENABLE_PRIVATE_API)
foreach(FILE ${GMSH_PRIVATE_API})
add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
-E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/gmsh/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endforeach()
if(HAVE_CONTRIB_EIGEN) # the private API depends on Eigen
add_custom_command(TARGET get_headers POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory contrib/eigen/Eigen
${CMAKE_CURRENT_BINARY_DIR}/Headers/gmsh/Eigen
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endif()
find_program(MAKEINFO makeinfo)
if(MAKEINFO)
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.info DEPENDS ${TEX_SRC}
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.info DEPENDS ${TEX_SRC}
COMMAND ${MAKEINFO} --split-size 1000000
ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
add_custom_target(info DEPENDS ${TEX_DIR}/gmsh.info)
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.txt DEPENDS ${TEX_SRC}
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.txt DEPENDS ${TEX_SRC}
COMMAND ${MAKEINFO} --plaintext -o gmsh.txt
ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
add_custom_target(txt DEPENDS ${TEX_DIR}/gmsh.txt)
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.html DEPENDS ${TEX_SRC}
COMMAND ${MAKEINFO} --html --no-split
ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.html DEPENDS ${TEX_SRC}
COMMAND ${MAKEINFO} --html --css-ref=/gmsh.css --no-split
--set-customization-variable EXTRA_HEAD='<meta name="viewport" content="width=device-width,initial-scale=1.0"><style type="text/css"><!-- img { width:66%\; max-width:768px } --></style>'
ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
add_custom_target(html DEPENDS ${TEX_DIR}/gmsh.html)
install(FILES ${TEX_DIR}/gmsh.html DESTINATION ${GMSH_DOC} OPTIONAL)
endif(MAKEINFO)
install(FILES ${TEX_IMG} DESTINATION ${GMSH_DOC}/images OPTIONAL)
else()
add_custom_target(html COMMAND ${CMAKE_COMMAND} -E touch ${TEX_DIR}/gmsh.html)
endif()
find_program(TEXI2PDF texi2pdf)
if(TEXI2PDF)
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.pdf DEPENDS ${TEX_SRC}
COMMAND ${TEXI2PDF} ARGS ${TEX_DIR}/gmsh.texi
add_custom_command(OUTPUT ${TEX_DIR}/gmsh.pdf DEPENDS ${TEX_SRC}
COMMAND ${TEXI2PDF} ARGS gmsh.texi
WORKING_DIRECTORY ${TEX_DIR})
add_custom_target(pdf DEPENDS ${TEX_DIR}/gmsh.pdf)
install(FILES ${TEX_DIR}/gmsh.pdf DESTINATION ${GMSH_DOC} OPTIONAL)
endif(TEXI2PDF)
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E echo
"@c This file was generated by cmake: do not edit manually!\n${OPT_TEXI}"
OUTPUT_FILE cmake_options.texi)
if(MAKEINFO AND TEXI2PDF)
add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E tar zcf
add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E tar zcf
${CMAKE_CURRENT_BINARY_DIR}/gmsh-${GMSH_VERSION}-doc.tgz
doc/CREDITS.txt doc/LICENSE.txt doc/VERSIONS.txt
doc/gmsh.1 doc/texinfo/gmsh.html doc/texinfo/gmsh.info
CREDITS.txt LICENSE.txt CHANGELOG.txt doc/gmsh.1
doc/texinfo/gmsh.html doc/texinfo/images doc/texinfo/gmsh.info
doc/texinfo/gmsh.pdf doc/texinfo/gmsh.txt
COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ}
DEPENDS ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.txt
${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.pdf
DEPENDS info txt html pdf
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif(MAKEINFO AND TEXI2PDF)
endif()
if(MAKEINFO OR TEXI2PDF)
add_custom_target(clean_doc COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ})
endif(MAKEINFO OR TEXI2PDF)
endif()
if(APPLE)
if(APPLE AND ENABLE_BUILD_LIB)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_framework.plist F0)
string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info_framework.plist "${F1}")
get_target_property(LIBNAME lib LOCATION)
set(LIBNAME $<TARGET_FILE:lib>)
add_custom_target(framework DEPENDS lib
COMMAND ${CMAKE_COMMAND} -E remove_directory Gmsh.framework
COMMAND ${CMAKE_COMMAND} -E make_directory Gmsh.framework/Versions/A/Headers
COMMAND ${CMAKE_COMMAND} -E make_directory Gmsh.framework/Versions/A/Resources
COMMAND ${CMAKE_COMMAND} -E copy ${LIBNAME} Gmsh.framework/Versions/A/Gmsh
COMMAND ${CMAKE_COMMAND} -E copy Info_framework.plist
Gmsh.framework/Versions/A/Resources/Info.plist
COMMAND ${CMAKE_COMMAND} -E create_symlink A Gmsh.framework/Versions/Current
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Gmsh
Gmsh.framework/Gmsh
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers
Gmsh.framework/Headers
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources
Gmsh.framework/Resources
COMMAND ${CMAKE_COMMAND} -E remove_directory gmsh.framework
COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Headers
COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Resources
COMMAND ${CMAKE_COMMAND} -E copy ${LIBNAME} gmsh.framework/gmsh
COMMAND ${CMAKE_COMMAND} -E copy Info_framework.plist
gmsh.framework/Resources/Info.plist
COMMAND ${CMAKE_COMMAND} -E create_symlink . gmsh.framework/Headers/gmsh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
foreach(FILE ${GMSH_API})
add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Gmsh.framework/Versions/A/Headers/
${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endforeach(FILE)
endif(APPLE)
endforeach()
if(ENABLE_PRIVATE_API)
foreach(FILE ${GMSH_PRIVATE_API})
add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endforeach()
if(HAVE_CONTRIB_EIGEN) # the private API depends on Eigen
add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND}
-E copy_directory contrib/eigen/Eigen
${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/Eigen
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endif()
endif()
set(CPACK_PACKAGE_VENDOR "Christophe Geuzaine and Jean-Francois Remacle")
set(CPACK_PACKAGE_VERSION_MAJOR ${GMSH_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${GMSH_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${GMSH_PATCH_VERSION})
set(CPACK_PACKAGE_DESCRIPTION_FILE ${WELCOME_FILE})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"3D finite element mesh generator with built-in CAD engine and post-processor")
set(CPACK_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-${GMSH_OS})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Gmsh")
if(GMSH_EXTRA_VERSION MATCHES "-git.*") # so that we'll overwrite the archives
set(CPACK_PACKAGE_FILE_NAME gmsh${GMSH_EXTRA_VERSION_ORIG}-git-${GMSH_OS})
set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh${GMSH_EXTRA_VERSION_ORIG}-git-source)
else()
set(CPACK_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-${GMSH_OS})
set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-source)
endif()
set(CPACK_PACKAGE_INSTALL_DIRECTORY "gmsh")
set(CPACK_RESOURCE_FILE_LICENSE ${LICENSE_FILE})
set(CPACK_RESOURCE_FILE_README ${WELCOME_FILE})
set(CPACK_RESOURCE_FILE_WELCOME ${WELCOME_FILE})
set(CPACK_PACKAGE_EXECUTABLE "gmsh;Gmsh")
set(CPACK_STRIP_FILES TRUE)
set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-source)
set(CPACK_PACKAGE_EXECUTABLE "gmsh")
if(ENABLE_PACKAGE_STRIP)
set(CPACK_STRIP_FILES TRUE)
else()
set(CPACK_STRIP_FILES FALSE)
endif()
set(CPACK_SOURCE_GENERATOR TGZ)
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}" "/CVS/" "/.svn" "~$"
"DS_Store$" "GmshConfig.h$" "GmshVersion.h$" "/benchmarks/" "/tmp/"
"/bin/" "/lib/" "/nightly/" "GPATH" "GRTAGS" "GSYMS" "GTAGS" "/HTML/"
"/projects/" "/TetgenNew/") #"/Tetgen.*/.*(cxx|h)")
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}" "/CVS/" "/.svn" "/.git"
"~$" "DS_Store$" "GmshConfig.h$" "GmshVersion.h$" "/benchmarks/" "/tmp/"
"/bin/" "/lib/" "/nightly/" "GPATH" "GRTAGS" "GSYMS" "GTAGS" "/HTML/"
"/contrib/3M/" "/contrib/Parasolid/")
if(UNIX)
# make sure we remove previous installs before doing the next one
# (on Mac for example "make package; make package_source" would lead
# to huge file lists getting generated due to the 'Applications'
# symlink in the bundle)
# make sure we remove previous installs before doing the next one (on Mac for
# example "make package; make package_source" would lead to huge file lists
# getting generated due to the 'Applications' symlink in the bundle)
set(CPACK_INSTALL_COMMANDS "rm -rf ${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages")
endif(UNIX)
endif()
if(APPLE)
if(APPLE AND ENABLE_OS_SPECIFIC_INSTALL AND HAVE_FLTK)
set(CPACK_GENERATOR Bundle)
set(CPACK_BUNDLE_NAME Gmsh)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_app.plist F0)
string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist "${F1}")
set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsGeo.icns DESTINATION .
set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIcons.icns)
if(PACKAGER STREQUAL "geuzaine")
# automatic codesigning of the .app
set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: Christophe Geuzaine")
# enable hardened runtime (necessary for notarization and app store)
set(CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER "--deep --force --options runtime")
endif()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIconsGeo.icns DESTINATION .
RENAME GmshGeo.icns)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsMsh.icns DESTINATION .
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIconsMsh.icns DESTINATION .
RENAME GmshMsh.icns)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsPos.icns DESTINATION .
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIconsSol.icns DESTINATION .
RENAME GmshSol.icns)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIconsPos.icns DESTINATION .
RENAME GmshPos.icns)
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk/MacIcons.icns)
elseif(WIN32)
set(CPACK_GENERATOR ZIP)
else(APPLE)
else()
set(CPACK_GENERATOR TGZ)
endif(APPLE)
endif()
include(CPack)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/gmshpy AND
ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON AND HAVE_PYTHON)
add_subdirectory(utils/wrappers/gmshpy)
endif()
message("")
message("Gmsh ${GMSH_VERSION} has been configured for ${GMSH_OS} with the "
"following options:" ${GMSH_CONFIG_OPTIONS})
message("")
message("C compiler: " ${CMAKE_C_COMPILER})
message("C++ compiler: " ${CMAKE_CXX_COMPILER})
if(NOT CMAKE_BUILD_TYPE)
message("C compiler flags: " ${CMAKE_C_FLAGS})
message("C++ compiler flags: " ${CMAKE_CXX_FLAGS})
else(NOT CMAKE_BUILD_TYPE)
message("Build type: " ${CMAKE_BUILD_TYPE})
endif(NOT CMAKE_BUILD_TYPE)
message("Install prefix: " ${CMAKE_INSTALL_PREFIX})
message("")
message("Run 'ccmake ${CMAKE_CURRENT_SOURCE_DIR}' to fine-tune the configuration.")
message("")
mark_as_advanced(BISON FLEX GMP_LIB GMSH_EXTRA_VERSION HDF5_LIB MAKEINFO
MED_LIB OCC_INC SZ_LIB TAUCS_LIB ACIS_LIB TEXI2PDF)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/java AND
ENABLE_PRIVATE_API AND ENABLE_WRAP_JAVA)
add_subdirectory(utils/wrappers/java)
endif()
include(CPack)
macro(filter_tests IN OUT)
unset(${OUT})
foreach(FILE ${IN})
unset(BAD1)
unset(BAD2)
unset(BAD3)
# OpenCASCADE
if(NOT HAVE_OCC)
file(STRINGS ${FILE} BAD1 REGEX "^SetFactory.*OpenCASCADE.*")
file(STRINGS ${FILE} BAD2 REGEX ".*occ.*synchronize.*")
file(STRINGS ${FILE} BAD3 REGEX ".*[mM]erge.*brep.*")
endif()
# Metis
if(NOT HAVE_METIS AND NOT BAD1 AND NOT BAD2 AND NOT BAD3)
file(STRINGS ${FILE} BAD1 REGEX ".*PartitionMesh.*")
file(STRINGS ${FILE} BAD2 REGEX ".*mesh.*partition.*")
endif()
if(BAD1 OR BAD2 OR BAD3)
message("Skipping test " ${FILE})
else()
list(APPEND ${OUT} ${FILE})
endif()
endforeach()
endmacro()
if(ENABLE_TESTS AND NOT DISABLE_GMSH_TESTS)
# disabling tests is useful when including this CMakeLists in an external project
include(CTest)
file(GLOB_RECURSE ALLFILES
tutorials/*.geo examples/*.geo benchmarks/?d/*.geo benchmarks/extrude/*.geo
benchmarks/occ/*.geo)
filter_tests("${ALLFILES}" TESTFILES)
foreach(TESTFILE ${TESTFILES})
# use relative path for Cygwin/MinGW (the pure win exe built with the MinGW
# compilers does not understand a full Cygwin-style path)
FILE(RELATIVE_PATH TEST ${CMAKE_CURRENT_BINARY_DIR} ${TESTFILE})
add_test(${TEST} ./gmsh ${TEST} -3 -nopopup -o ./tmp.msh)
endforeach()
# test c++ api tutorials with dynamic builds
if(ENABLE_BUILD_DYNAMIC)
file(GLOB_RECURSE ALLFILES tutorials/c++/*.cpp tutorials/c/*.c)
filter_tests("${ALLFILES}" TESTFILES)
foreach(TESTFILE ${TESTFILES})
get_filename_component(TEST ${TESTFILE} NAME)
string(REPLACE "\." "_" TEST ${TEST})
add_executable(${TEST} WIN32 ${TESTFILE})
target_link_libraries(${TEST} shared)
if(WIN32 AND NOT MSVC)
set(FLAGS "-static")
if(HAVE_FLTK)
set(FLAGS "${FLAGS} -mwindows")
else()
set(FLAGS "${FLAGS} -mconsole")
endif()
set_target_properties(${TEST} PROPERTIES LINK_FLAGS "${FLAGS}")
endif()
add_test(${TEST} ${TEST} -nopopup)
endforeach()
endif()
# enable this once we have worked out the path issues on the build machines
if(0 AND ENABLE_BUILD_DYNAMIC)
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
file(GLOB_RECURSE ALLFILES tutorials/python/*.py examples/api/*.py)
filter_tests("${ALLFILES}" TESTFILES)
foreach(TESTFILE ${TESTFILES})
get_filename_component(TEST ${TESTFILE} NAME)
string(REPLACE "\." "_" TEST ${TEST})
add_test(NAME ${TEST} COMMAND ${PYTHON_EXECUTABLE} ${TESTFILE} -nopopup)
set_property(TEST ${TEST} APPEND PROPERTY ENVIRONMENT
"PYTHONPATH=${CMAKE_SOURCE_DIR}/api")
set_property(TEST ${TEST} APPEND PROPERTY ENVIRONMENT
"LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}")
endforeach()
endif()
endif()
endif()
message(STATUS "")
message(STATUS "Gmsh ${GMSH_VERSION} has been configured for ${GMSH_OS}")
message(STATUS "")
message(STATUS " * Build options:" ${GMSH_CONFIG_OPTIONS})
message(STATUS " * Build type: " ${CMAKE_BUILD_TYPE})
message(STATUS " * C compiler: " ${CMAKE_C_COMPILER})
message(STATUS " * C++ compiler: " ${CMAKE_CXX_COMPILER})
message(STATUS " * Install prefix: " ${CMAKE_INSTALL_PREFIX})
message(STATUS "")
mark_as_advanced(ANN_INC ANN_LIB CAIRO_LIB CAIRO_INC CGNS_INC GMM_INC
GMP_INC GMP_LIB MMG_INC MMG_LIB HDF5_LIB
MED_LIB OCC_INC SZ_LIB
PETSC_LIBS SLEPC_INC SLEPC_INC2 SLEPC_LIB
BISON FLEX MAKEINFO TEXI2PDF FLTK_CONFIG_SCRIPT
GMSH_EXTERNAL_INCLUDE_DIRS GMSH_EXTERNAL_LIBRARIES)
Gmsh is copyright (C) 1997-2024
Christophe Geuzaine
<cgeuzaine at uliege.be>
and
Jean-Francois Remacle
<jean-francois.remacle at uclouvain.be>
Code contributions to Gmsh have been provided by David Colignon (colormaps),
Emilie Marchandise (old compound geometrical entities), Gaetan Bricteux (Gauss
integration and levelsets), Jacques Lechelle (DIFFPACK export), Jonathan
Lambrechts (mesh size fields, solver, Python wrappers), Jozef Vesely (old Tetgen
integration), Koen Hillewaert (high order elements, generalized periodic
meshes), Laurent Stainier (eigenvalue solvers, tensor display and help with
macOS port), Marc Ume (original list and tree code), Mark van Doesburg (old
OpenCASCADE face connection), Matt Gundry (Plot3d export), Matti Pellikka (cell
complex and homology solver), Nicolas Tardieu (help with Netgen integration),
Pascale Noyret (MED mesh IO), Pierre Badel (root finding and minimization), Ruth
Sabariego (pyramids), Stephen Guzik (old CGNS IO, old partitioning code),
Bastien Gorissen (parallel remote post-processing), Eric Bechet (solver), Gilles
Marckmann (camera and stero mode, X3D export), Ashish Negi (Netgen CAD healing),
Trevor Strickler (hybrid structured mesh coupling with pyramids), Amaury Johnen
(Bezier code, high-order element validity), Benjamin Ruard (old Java wrappers),
Maxime Graulich (iOS/Android port), Francois Henrotte (ONELAB metamodels),
Sebastian Eiser (PGF export), Alexis Salzman (compressed IO), Hang Si (TetGen/BR
boundary recovery code), Fernando Lorenzo (Tochnog export), Larry Price (Gambit
export), Anthony Royer (new partitioning code, MSH4 IO), Darcy Beurle (code
cleanup and performance improvements), Celestin Marot (HXT/tetMesh),
Pierre-Alexandre Beaufort (HXT/reparam), Zhidong Han (LSDYNA export), Ismail
Badia (hierarchical basis functions), Jeremy Theler (X3D export), Thomas
Toulorge (high order mesh optimizer, new CGNS IO), Max Orok (binary PLY), Marek
Wojciechowski (PyPi packaging), Maxence Reberol (automatic transfinite, quad
meshing tools), Michael Ermakov (Gambit IO, Fortran API, TransfiniteTri,
boundary layer fans), Alex Krasner (X3D export), Giannis Nikiteas (Fortran API),
Paul Sharp (Radioss export), Marco Failla (2D fillet/offset and API
additions). See comments in the sources for more information. If we forgot to
list your contributions please send us an email!
Thanks to the following folks who have contributed by providing fresh ideas on
theoretical or programming topics, who have sent patches, requests for changes
or improvements, or who gave us access to exotic machines for testing Gmsh: Juan
Abanto, Olivier Adam, Guillaume Alleon, Laurent Champaney, Pascal Dupuis,
Patrick Dular, Philippe Geuzaine, Johan Gyselinck, Francois Henrotte, Benoit
Meys, Nicolas Moes, Osamu Nakamura, Chad Schmutzer, Jean-Luc Fl'ejou, Xavier
Dardenne, Christophe Prud'homme, Sebastien Clerc, Jose Miguel Pasini, Philippe
Lussou, Jacques Kools, Bayram Yenikaya, Peter Hornby, Krishna Mohan Gundu,
Christopher Stott, Timmy Schumacher, Carl Osterwisch, Bruno Frackowiak, Philip
Kelleners, Romuald Conty, Renaud Sizaire, Michel Benhamou, Tom De Vuyst, Kris
Van den Abeele, Simon Vun, Simon Corbin, Thomas De-Soza, Marcus Drosson, Antoine
Dechaume, Jose Paulo Moitinho de Almeida, Thomas Pinchard, Corrado Chisari, Axel
Hackbarth, Peter Wainwright, Jiri Hnidek, Thierry Thomas, Konstantinos Poulios,
Laurent Van Miegroet, Shahrokh Ghavamian, Geordie McBain, Jose Paulo Moitinho de
Almeida, Guillaume Demesy, Wendy Merks-Swolfs, Cosmin Stefan Deaconu, Nigel
Nunn, Serban Georgescu, Julien Troufflard, Michele Mocciola, Matthijs Sypkens
Smit, Sauli Ruuska, Romain Boman, Fredrik Ekre, Mark Burton, Max Orok, Paul
Cristini, Isuru Fernando, Jose Paulo Moitinho de Almeida, Sophie Le Bras,
Alberto Escrig, Samy Mukadi, Peter Johnston, Bruno de Sousa Alves, Stefan
Bruens, Luca Verzeroli, Tristan Seidlhofer, Ding Jiaming, Joost Gevaert, Marcus
Calhoun-Lopez, Michel Zou, Sir Sunsheep, Mariano Forti, Walter Steffe, Nico
Schloemer, Simon Tournier, Alexandru Dadalau, Thomas Ulrich, Matthias Diener,
Jamie Border, Kenneth Jansen, Steven Masfaraud, Sai Sumanth Moturu, Arie
Westland, Andreas Farley, Mahesh Madhav, Zoltan Csati, Thierry Hocquellet,
Christophe Bourcier, Mattéo Couplet, Giuseppe Musacchio, Romin Tomasetti, Lin Qi
Chen, Tim Furlan, Matthias Lang, Tim Gabriel, Julien Chapelat, Boris Martin,
Thomas Pirottin, Kazuyoshi Furutaka, Mariusz Wozniak, Christophe Friebel,
Thierry Thomas, Joonas Haapsaari, Jani V"alimaa, Erik Schaubelt, Louis Denis,
Francis Franklin, Florian Blachère, Aleksandr Artemyev, Carlos Ballesteros,
Theodore Chang, Tom Gillam.
Special thanks to Bill Spitzak, Michael Sweet, Matthias Melcher, Greg Ercolano
and others for the Fast Light Tool Kit on which Gmsh's GUI is based. See
http://www.fltk.org for more info on this excellent object-oriented,
cross-platform toolkit. Special thanks also to EDF for funding the original
OpenCASCADE and MED integration in 2006-2007. Gmsh development was also
financially supported by the PRACE project funded in part by the EU's Horizon
2020 Research and Innovation programme (2014-2020) under grant agreement 823767.
The TetGen/BR code (src/mesh/tetgenBR.{cpp,h}) is copyright (c) 2016 Hang Si,
Weierstrass Institute for Applied Analysis and Stochatics. It is relicensed
under the terms of LICENSE.txt for use in Gmsh thanks to a Software License
Agreement between Weierstrass Institute for Applied Analysis and Stochastics and
GMESH SPRL.
The AVL tree code (src/common/avl.{cpp,h}) and the YUV image code
(src/graphics/gl2yuv.{cpp,h}) are copyright (C) 1988-1993, 1995 The Regents of
the University of California. Permission to use, copy, modify, and distribute
this software and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in supporting
documentation, and that the name of the University of California not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. The University of California makes no
representations about the suitability of this software for any purpose. It is
provided "as is" without express or implied warranty.
The picojson code (src/common/picojson.h) is Copyright 2009-2010 Cybozu Labs,
Inc., Copyright 2011-2014 Kazuho Oku, All rights reserved. Redistribution and
use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met: 1. Redistributions of source
code must retain the above copyright notice, this list of conditions and the
following disclaimer. 2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. THIS
SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The nanoflann code (src/numeric/nanoflann.hpp) is Copyright 2008-2009 Marius
Muja, 2008-2009 David G. Lowe, 2011-2016 Jose Luis Blanco. Redistribution and
use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met: 1. Redistributions of source
code must retain the above copyright notice, this list of conditions and the
following disclaimer. 2. Redistributions in binary form must reproduce the
above copyright notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution. THIS
SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
The trackball code (src/graphics/Trackball.{cpp.h}) is copyright (C) 1993, 1994,
Silicon Graphics, Inc. ALL RIGHTS RESERVED. Permission to use, copy, modify, and
distribute this software for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that both the
copyright notice and this permission notice appear in supporting documentation,
and that the name of Silicon Graphics, Inc. not be used in advertising or
publicity pertaining to distribution of the software without specific, written
prior permission.
The GIF and PPM routines (src/graphics/gl2gif.cpp) are based on code copyright
(C) 1989, 1991, Jef Poskanzer. Permission to use, copy, modify, and distribute
this software and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in supporting
documentation. This software is provided "as is" without express or implied
warranty.
The colorbar widget (src/fltk/colorbarWindow.cpp) was inspired by code from the
Vis5d program for visualizing five dimensional gridded data sets, copyright (C)
1990-1995, Bill Hibbard, Brian Paul, Dave Santek, and Andre Battaiola.
The libOL code (src/common/libol1.{c,h}) is Copyright 2012-2018 - by Loïc
Maréchal / INRIA. This program is a free software. You can redistribute it
and/or modify it under the terms of the MIT License as published by the Open
Source Initiative.
The Fast & memory efficient hashtable based on robin hood hashing
(src/common/robin_hood.h) is Copyright (c) 2018-2020 Martin Ankerl and is
licensed under the MIT License.
In addition, this version of Gmsh may contain the following contributed,
optional codes in the contrib/ directory, each governed by their own license:
* contrib/ANN copyright (C) 1997-2010 University of Maryland and Sunil Arya and
David Mount;
* contrib/gmm copyright (C) 2002-2008 Yves Renard;
* contrib/hxt - Copyright (C) 2017-2020 - Universite catholique de Louvain;
* contrib/kbipack copyright (C) 2005 Saku Suuriniemi;
* contrib/MathEx based in part on the work of the SSCILIB Library, copyright (C)
2000-2003 Sadao Massago;
* contrib/metis written by George Karypis (karypis at cs.umn.edu), copyright (C)
1995-2013 Regents of the University of Minnesota;
* contrib/mpeg_encode copyright (c) 1995 The Regents of the University of
California;
* contrib/Netgen copyright (C) 1994-2004 Joachim Sch"oberl;
* contrib/bamg from Freefem++ copyright (C) Frederic Hecht;
* contrib/ALGLIB (C) Sergey Bochkanov (ALGLIB project);
* contrib/blossom copyright (C) 1995-1997 Bill Cook et al.;
* contrib/bamg from Freefem++ copyright (C) Frederic Hecht;
* contrib/tinyxml2 from Lee Thomason;
* contrib/voro++ from Voro++ Copyright (c) 2008, The Regents of the University
of California, through Lawrence Berkeley National Laboratory (subject to
receipt of any required approvals from the U.S. Dept. of Energy). All rights
reserved;
* contrib/zipper from MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant -
version 1.1 64 bits from Mathias Svensson.
Check the configuration options to see which have been enabled.
# Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
#
# See the LICENSE.txt file for license information. Please report all
# bugs and problems to <gmsh@geuz.org>.
set(SRC
Gmsh.cpp
GmshRemote.cpp
GmshMessage.cpp
Context.cpp
Options.cpp
CommandLine.cpp
OS.cpp
OpenFile.cpp
CreateFile.cpp
VertexArray.cpp
SmoothData.cpp
Octree.cpp
OctreeInternals.cpp
StringUtils.cpp
ListUtils.cpp
TreeUtils.cpp avl.cpp
MallocUtils.cpp
ConnectionManager.cpp
)
file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
append_gmsh_src(Common "${SRC};${HDR}")
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _COLORS_H_
#define _COLORS_H_
#include "Options.h"
StringX4Int ColorString[] = {
{ "Snow" , 255, 250, 250, 255 } ,
{ "GhostWhite" , 248, 248, 255, 255 } ,
{ "WhiteSmoke" , 245, 245, 245, 255 } ,
{ "Gainsboro" , 220, 220, 220, 255 } ,
{ "FloralWhite" , 255, 250, 240, 255 } ,
{ "OldLace" , 253, 245, 230, 255 } ,
{ "Linen" , 250, 240, 230, 255 } ,
{ "AntiqueWhite" , 250, 235, 215, 255 } ,
{ "PapayaWhip" , 255, 239, 213, 255 } ,
{ "BlanchedAlmond" , 255, 235, 205, 255 } ,
{ "Bisque" , 255, 228, 196, 255 } ,
{ "PeachPuff" , 255, 218, 185, 255 } ,
{ "NavajoWhite" , 255, 222, 173, 255 } ,
{ "Moccasin" , 255, 228, 181, 255 } ,
{ "Cornsilk" , 255, 248, 220, 255 } ,
{ "Ivory" , 255, 255, 240, 255 } ,
{ "LemonChiffon" , 255, 250, 205, 255 } ,
{ "Seashell" , 255, 245, 238, 255 } ,
{ "Honeydew" , 240, 255, 240, 255 } ,
{ "MintCream" , 245, 255, 250, 255 } ,
{ "Azure" , 240, 255, 255, 255 } ,
{ "AliceBlue" , 240, 248, 255, 255 } ,
{ "Lavender" , 230, 230, 250, 255 } ,
{ "LavenderBlush" , 255, 240, 245, 255 } ,
{ "MistyRose" , 255, 228, 225, 255 } ,
{ "White" , 255, 255, 255, 255 } ,
{ "Black" , 0, 0, 0, 255 } ,
{ "DarkSlateGray" , 47, 79, 79, 255 } ,
{ "DarkSlateGrey" , 47, 79, 79, 255 } ,
{ "DimGray" , 105, 105, 105, 255 } ,
{ "DimGrey" , 105, 105, 105, 255 } ,
{ "SlateGray" , 112, 128, 144, 255 } ,
{ "SlateGrey" , 112, 128, 144, 255 } ,
{ "LightSlateGray" , 119, 136, 153, 255 } ,
{ "LightSlateGrey" , 119, 136, 153, 255 } ,
{ "Gray" , 190, 190, 190, 255 } ,
{ "Grey" , 190, 190, 190, 255 } ,
{ "LightGrey" , 211, 211, 211, 255 } ,
{ "LightGray" , 211, 211, 211, 255 } ,
{ "MidnightBlue" , 25, 25, 112, 255 } ,
{ "Navy" , 0, 0, 128, 255 } ,
{ "NavyBlue" , 0, 0, 128, 255 } ,
{ "CornflowerBlue" , 100, 149, 237, 255 } ,
{ "DarkSlateBlue" , 72, 61, 139, 255 } ,
{ "SlateBlue" , 106, 90, 205, 255 } ,
{ "MediumSlateBlue" , 123, 104, 238, 255 } ,
{ "LightSlateBlue" , 132, 112, 255, 255 } ,
{ "MediumBlue" , 0, 0, 205, 255 } ,
{ "RoyalBlue" , 65, 105, 225, 255 } ,
{ "Blue" , 0, 0, 255, 255 } ,
{ "DodgerBlue" , 30, 144, 255, 255 } ,
{ "DeepSkyBlue" , 0, 191, 255, 255 } ,
{ "SkyBlue" , 135, 206, 235, 255 } ,
{ "LightSkyBlue" , 135, 206, 250, 255 } ,
{ "SteelBlue" , 70, 130, 180, 255 } ,
{ "LightSteelBlue" , 176, 196, 222, 255 } ,
{ "LightBlue" , 173, 216, 230, 255 } ,
{ "PowderBlue" , 176, 224, 230, 255 } ,
{ "PaleTurquoise" , 175, 238, 238, 255 } ,
{ "DarkTurquoise" , 0, 206, 209, 255 } ,
{ "MediumTurquoise" , 72, 209, 204, 255 } ,
{ "Turquoise" , 64, 224, 208, 255 } ,
{ "Cyan" , 0, 255, 255, 255 } ,
{ "LightCyan" , 224, 255, 255, 255 } ,
{ "CadetBlue" , 95, 158, 160, 255 } ,
{ "MediumAquamarine" , 102, 205, 170, 255 } ,
{ "Aquamarine" , 127, 255, 212, 255 } ,
{ "DarkGreen" , 0, 100, 0, 255 } ,
{ "DarkOliveGreen" , 85, 107, 47, 255 } ,
{ "DarkSeaGreen" , 143, 188, 143, 255 } ,
{ "SeaGreen" , 46, 139, 87, 255 } ,
{ "MediumSeaGreen" , 60, 179, 113, 255 } ,
{ "LightSeaGreen" , 32, 178, 170, 255 } ,
{ "PaleGreen" , 152, 251, 152, 255 } ,
{ "SpringGreen" , 0, 255, 127, 255 } ,
{ "LawnGreen" , 124, 252, 0, 255 } ,
{ "Green" , 0, 255, 0, 255 } ,
{ "chartreuse" , 127, 255, 0, 255 } ,
{ "MediumSpringGreen" , 0, 250, 154, 255 } ,
{ "GreenYellow" , 173, 255, 47, 255 } ,
{ "LimeGreen" , 50, 205, 50, 255 } ,
{ "YellowGreen" , 154, 205, 50, 255 } ,
{ "ForestGreen" , 34, 139, 34, 255 } ,
{ "OliveDrab" , 107, 142, 35, 255 } ,
{ "DarkKhaki" , 189, 183, 107, 255 } ,
{ "Khaki" , 240, 230, 140, 255 } ,
{ "PaleGoldenrod" , 238, 232, 170, 255 } ,
{ "LightGoldenrodYellow" , 250, 250, 210, 255 } ,
{ "LightYellow" , 255, 255, 224, 255 } ,
{ "Yellow" , 255, 255, 0, 255 } ,
{ "Gold" , 255, 215, 0, 255 } ,
{ "LightGoldenrod" , 238, 221, 130, 255 } ,
{ "Goldenrod" , 218, 165, 32, 255 } ,
{ "DarkGoldenrod" , 184, 134, 11, 255 } ,
{ "RosyBrown" , 188, 143, 143, 255 } ,
{ "IndianRed" , 205, 92, 92, 255 } ,
{ "SaddleBrown" , 139, 69, 19, 255 } ,
{ "Sienna" , 160, 82, 45, 255 } ,
{ "Peru" , 205, 133, 63, 255 } ,
{ "Burlywood" , 222, 184, 135, 255 } ,
{ "Beige" , 245, 245, 220, 255 } ,
{ "Wheat" , 245, 222, 179, 255 } ,
{ "SandyBrown" , 244, 164, 96, 255 } ,
{ "Tan" , 210, 180, 140, 255 } ,
{ "Chocolate" , 210, 105, 30, 255 } ,
{ "Firebrick" , 178, 34, 34, 255 } ,
{ "Brown" , 165, 42, 42, 255 } ,
{ "DarkSalmon" , 233, 150, 122, 255 } ,
{ "Salmon" , 250, 128, 114, 255 } ,
{ "LightSalmon" , 255, 160, 122, 255 } ,
{ "Orange" , 255, 165, 0, 255 } ,
{ "DarkOrange" , 255, 140, 0, 255 } ,
{ "Coral" , 255, 127, 80, 255 } ,
{ "LightCoral" , 240, 128, 128, 255 } ,
{ "Tomato" , 255, 99, 71, 255 } ,
{ "OrangeRed" , 255, 69, 0, 255 } ,
{ "Red" , 255, 0, 0, 255 } ,
{ "HotPink" , 255, 105, 180, 255 } ,
{ "DeepPink" , 255, 20, 147, 255 } ,
{ "Pink" , 255, 192, 203, 255 } ,
{ "LightPink" , 255, 182, 193, 255 } ,
{ "PaleVioletRed" , 219, 112, 147, 255 } ,
{ "Maroon" , 176, 48, 96, 255 } ,
{ "MediumVioletRed" , 199, 21, 133, 255 } ,
{ "VioletRed" , 208, 32, 144, 255 } ,
{ "Magenta" , 255, 0, 255, 255 } ,
{ "Violet" , 238, 130, 238, 255 } ,
{ "Plum" , 221, 160, 221, 255 } ,
{ "Orchid" , 218, 112, 214, 255 } ,
{ "MediumOrchid" , 186, 85, 211, 255 } ,
{ "DarkOrchid" , 153, 50, 204, 255 } ,
{ "DarkViolet" , 148, 0, 211, 255 } ,
{ "BlueViolet" , 138, 43, 226, 255 } ,
{ "Purple" , 160, 32, 240, 255 } ,
{ "MediumPurple" , 147, 112, 219, 255 } ,
{ "Thistle" , 216, 191, 216, 255 } ,
{ "Snow1" , 255, 250, 250, 255 } ,
{ "Snow2" , 238, 233, 233, 255 } ,
{ "Snow3" , 205, 201, 201, 255 } ,
{ "Snow4" , 139, 137, 137, 255 } ,
{ "Seashell1" , 255, 245, 238, 255 } ,
{ "Seashell2" , 238, 229, 222, 255 } ,
{ "Seashell3" , 205, 197, 191, 255 } ,
{ "Seashell4" , 139, 134, 130, 255 } ,
{ "AntiqueWhite1" , 255, 239, 219, 255 } ,
{ "AntiqueWhite2" , 238, 223, 204, 255 } ,
{ "AntiqueWhite3" , 205, 192, 176, 255 } ,
{ "AntiqueWhite4" , 139, 131, 120, 255 } ,
{ "Bisque1" , 255, 228, 196, 255 } ,
{ "Bisque2" , 238, 213, 183, 255 } ,
{ "Bisque3" , 205, 183, 158, 255 } ,
{ "Bisque4" , 139, 125, 107, 255 } ,
{ "PeachPuff1" , 255, 218, 185, 255 } ,
{ "PeachPuff2" , 238, 203, 173, 255 } ,
{ "PeachPuff3" , 205, 175, 149, 255 } ,
{ "PeachPuff4" , 139, 119, 101, 255 } ,
{ "NavajoWhite1" , 255, 222, 173, 255 } ,
{ "NavajoWhite2" , 238, 207, 161, 255 } ,
{ "NavajoWhite3" , 205, 179, 139, 255 } ,
{ "NavajoWhite4" , 139, 121, 94, 255 } ,
{ "LemonChiffon1" , 255, 250, 205, 255 } ,
{ "LemonChiffon2" , 238, 233, 191, 255 } ,
{ "LemonChiffon3" , 205, 201, 165, 255 } ,
{ "LemonChiffon4" , 139, 137, 112, 255 } ,
{ "Cornsilk1" , 255, 248, 220, 255 } ,
{ "Cornsilk2" , 238, 232, 205, 255 } ,
{ "Cornsilk3" , 205, 200, 177, 255 } ,
{ "Cornsilk4" , 139, 136, 120, 255 } ,
{ "Ivory1" , 255, 255, 240, 255 } ,
{ "Ivory2" , 238, 238, 224, 255 } ,
{ "Ivory3" , 205, 205, 193, 255 } ,
{ "Ivory4" , 139, 139, 131, 255 } ,
{ "Honeydew1" , 240, 255, 240, 255 } ,
{ "Honeydew2" , 224, 238, 224, 255 } ,
{ "Honeydew3" , 193, 205, 193, 255 } ,
{ "Honeydew4" , 131, 139, 131, 255 } ,
{ "LavenderBlush1" , 255, 240, 245, 255 } ,
{ "LavenderBlush2" , 238, 224, 229, 255 } ,
{ "LavenderBlush3" , 205, 193, 197, 255 } ,
{ "LavenderBlush4" , 139, 131, 134, 255 } ,
{ "MistyRose1" , 255, 228, 225, 255 } ,
{ "MistyRose2" , 238, 213, 210, 255 } ,
{ "MistyRose3" , 205, 183, 181, 255 } ,
{ "MistyRose4" , 139, 125, 123, 255 } ,
{ "Azure1" , 240, 255, 255, 255 } ,
{ "Azure2" , 224, 238, 238, 255 } ,
{ "Azure3" , 193, 205, 205, 255 } ,
{ "Azure4" , 131, 139, 139, 255 } ,
{ "SlateBlue1" , 131, 111, 255, 255 } ,
{ "SlateBlue2" , 122, 103, 238, 255 } ,
{ "SlateBlue3" , 105, 89, 205, 255 } ,
{ "SlateBlue4" , 71, 60, 139, 255 } ,
{ "RoyalBlue1" , 72, 118, 255, 255 } ,
{ "RoyalBlue2" , 67, 110, 238, 255 } ,
{ "RoyalBlue3" , 58, 95, 205, 255 } ,
{ "RoyalBlue4" , 39, 64, 139, 255 } ,
{ "Blue1" , 0, 0, 255, 255 } ,
{ "Blue2" , 0, 0, 238, 255 } ,
{ "Blue3" , 0, 0, 205, 255 } ,
{ "Blue4" , 0, 0, 139, 255 } ,
{ "DodgerBlue1" , 30, 144, 255, 255 } ,
{ "DodgerBlue2" , 28, 134, 238, 255 } ,
{ "DodgerBlue3" , 24, 116, 205, 255 } ,
{ "DodgerBlue4" , 16, 78, 139, 255 } ,
{ "SteelBlue1" , 99, 184, 255, 255 } ,
{ "SteelBlue2" , 92, 172, 238, 255 } ,
{ "SteelBlue3" , 79, 148, 205, 255 } ,
{ "SteelBlue4" , 54, 100, 139, 255 } ,
{ "DeepSkyBlue1" , 0, 191, 255, 255 } ,
{ "DeepSkyBlue2" , 0, 178, 238, 255 } ,
{ "DeepSkyBlue3" , 0, 154, 205, 255 } ,
{ "DeepSkyBlue4" , 0, 104, 139, 255 } ,
{ "SkyBlue1" , 135, 206, 255, 255 } ,
{ "SkyBlue2" , 126, 192, 238, 255 } ,
{ "SkyBlue3" , 108, 166, 205, 255 } ,
{ "SkyBlue4" , 74, 112, 139, 255 } ,
{ "LightSkyBlue1" , 176, 226, 255, 255 } ,
{ "LightSkyBlue2" , 164, 211, 238, 255 } ,
{ "LightSkyBlue3" , 141, 182, 205, 255 } ,
{ "LightSkyBlue4" , 96, 123, 139, 255 } ,
{ "SlateGray1" , 198, 226, 255, 255 } ,
{ "SlateGray2" , 185, 211, 238, 255 } ,
{ "SlateGray3" , 159, 182, 205, 255 } ,
{ "SlateGray4" , 108, 123, 139, 255 } ,
{ "LightSteelBlue1" , 202, 225, 255, 255 } ,
{ "LightSteelBlue2" , 188, 210, 238, 255 } ,
{ "LightSteelBlue3" , 162, 181, 205, 255 } ,
{ "LightSteelBlue4" , 110, 123, 139, 255 } ,
{ "LightBlue1" , 191, 239, 255, 255 } ,
{ "LightBlue2" , 178, 223, 238, 255 } ,
{ "LightBlue3" , 154, 192, 205, 255 } ,
{ "LightBlue4" , 104, 131, 139, 255 } ,
{ "LightCyan1" , 224, 255, 255, 255 } ,
{ "LightCyan2" , 209, 238, 238, 255 } ,
{ "LightCyan3" , 180, 205, 205, 255 } ,
{ "LightCyan4" , 122, 139, 139, 255 } ,
{ "PaleTurquoise1" , 187, 255, 255, 255 } ,
{ "PaleTurquoise2" , 174, 238, 238, 255 } ,
{ "PaleTurquoise3" , 150, 205, 205, 255 } ,
{ "PaleTurquoise4" , 102, 139, 139, 255 } ,
{ "CadetBlue1" , 152, 245, 255, 255 } ,
{ "CadetBlue2" , 142, 229, 238, 255 } ,
{ "CadetBlue3" , 122, 197, 205, 255 } ,
{ "CadetBlue4" , 83, 134, 139, 255 } ,
{ "Turquoise1" , 0, 245, 255, 255 } ,
{ "Turquoise2" , 0, 229, 238, 255 } ,
{ "Turquoise3" , 0, 197, 205, 255 } ,
{ "Turquoise4" , 0, 134, 139, 255 } ,
{ "Cyan1" , 0, 255, 255, 255 } ,
{ "Cyan2" , 0, 238, 238, 255 } ,
{ "Cyan3" , 0, 205, 205, 255 } ,
{ "Cyan4" , 0, 139, 139, 255 } ,
{ "DarkSlateGray1" , 151, 255, 255, 255 } ,
{ "DarkSlateGray2" , 141, 238, 238, 255 } ,
{ "DarkSlateGray3" , 121, 205, 205, 255 } ,
{ "DarkSlateGray4" , 82, 139, 139, 255 } ,
{ "Aquamarine1" , 127, 255, 212, 255 } ,
{ "Aquamarine2" , 118, 238, 198, 255 } ,
{ "Aquamarine3" , 102, 205, 170, 255 } ,
{ "Aquamarine4" , 69, 139, 116, 255 } ,
{ "DarkSeaGreen1" , 193, 255, 193, 255 } ,
{ "DarkSeaGreen2" , 180, 238, 180, 255 } ,
{ "DarkSeaGreen3" , 155, 205, 155, 255 } ,
{ "DarkSeaGreen4" , 105, 139, 105, 255 } ,
{ "SeaGreen1" , 84, 255, 159, 255 } ,
{ "SeaGreen2" , 78, 238, 148, 255 } ,
{ "SeaGreen3" , 67, 205, 128, 255 } ,
{ "SeaGreen4" , 46, 139, 87, 255 } ,
{ "PaleGreen1" , 154, 255, 154, 255 } ,
{ "PaleGreen2" , 144, 238, 144, 255 } ,
{ "PaleGreen3" , 124, 205, 124, 255 } ,
{ "PaleGreen4" , 84, 139, 84, 255 } ,
{ "SpringGreen1" , 0, 255, 127, 255 } ,
{ "SpringGreen2" , 0, 238, 118, 255 } ,
{ "SpringGreen3" , 0, 205, 102, 255 } ,
{ "SpringGreen4" , 0, 139, 69, 255 } ,
{ "Green1" , 0, 255, 0, 255 } ,
{ "Green2" , 0, 238, 0, 255 } ,
{ "Green3" , 0, 205, 0, 255 } ,
{ "Green4" , 0, 139, 0, 255 } ,
{ "Chartreuse1" , 127, 255, 0, 255 } ,
{ "Chartreuse2" , 118, 238, 0, 255 } ,
{ "Chartreuse3" , 102, 205, 0, 255 } ,
{ "Chartreuse4" , 69, 139, 0, 255 } ,
{ "OliveDrab1" , 192, 255, 62, 255 } ,
{ "OliveDrab2" , 179, 238, 58, 255 } ,
{ "OliveDrab3" , 154, 205, 50, 255 } ,
{ "OliveDrab4" , 105, 139, 34, 255 } ,
{ "DarkOliveGreen1" , 202, 255, 112, 255 } ,
{ "DarkOliveGreen2" , 188, 238, 104, 255 } ,
{ "DarkOliveGreen3" , 162, 205, 90, 255 } ,
{ "DarkOliveGreen4" , 110, 139, 61, 255 } ,
{ "Khaki1" , 255, 246, 143, 255 } ,
{ "Khaki2" , 238, 230, 133, 255 } ,
{ "Khaki3" , 205, 198, 115, 255 } ,
{ "Khaki4" , 139, 134, 78, 255 } ,
{ "LightGoldenrod1" , 255, 236, 139, 255 } ,
{ "LightGoldenrod2" , 238, 220, 130, 255 } ,
{ "LightGoldenrod3" , 205, 190, 112, 255 } ,
{ "LightGoldenrod4" , 139, 129, 76, 255 } ,
{ "LightYellow1" , 255, 255, 224, 255 } ,
{ "LightYellow2" , 238, 238, 209, 255 } ,
{ "LightYellow3" , 205, 205, 180, 255 } ,
{ "LightYellow4" , 139, 139, 122, 255 } ,
{ "Yellow1" , 255, 255, 0, 255 } ,
{ "Yellow2" , 238, 238, 0, 255 } ,
{ "Yellow3" , 205, 205, 0, 255 } ,
{ "Yellow4" , 139, 139, 0, 255 } ,
{ "Gold1" , 255, 215, 0, 255 } ,
{ "Gold2" , 238, 201, 0, 255 } ,
{ "Gold3" , 205, 173, 0, 255 } ,
{ "Gold4" , 139, 117, 0, 255 } ,
{ "Goldenrod1" , 255, 193, 37, 255 } ,
{ "Goldenrod2" , 238, 180, 34, 255 } ,
{ "Goldenrod3" , 205, 155, 29, 255 } ,
{ "Goldenrod4" , 139, 105, 20, 255 } ,
{ "DarkGoldenrod1" , 255, 185, 15, 255 } ,
{ "DarkGoldenrod2" , 238, 173, 14, 255 } ,
{ "DarkGoldenrod3" , 205, 149, 12, 255 } ,
{ "DarkGoldenrod4" , 139, 101, 8, 255 } ,
{ "RosyBrown1" , 255, 193, 193, 255 } ,
{ "RosyBrown2" , 238, 180, 180, 255 } ,
{ "RosyBrown3" , 205, 155, 155, 255 } ,
{ "RosyBrown4" , 139, 105, 105, 255 } ,
{ "IndianRed1" , 255, 106, 106, 255 } ,
{ "IndianRed2" , 238, 99, 99, 255 } ,
{ "IndianRed3" , 205, 85, 85, 255 } ,
{ "IndianRed4" , 139, 58, 58, 255 } ,
{ "Sienna1" , 255, 130, 71, 255 } ,
{ "Sienna2" , 238, 121, 66, 255 } ,
{ "Sienna3" , 205, 104, 57, 255 } ,
{ "Sienna4" , 139, 71, 38, 255 } ,
{ "Burlywood1" , 255, 211, 155, 255 } ,
{ "Burlywood2" , 238, 197, 145, 255 } ,
{ "Burlywood3" , 205, 170, 125, 255 } ,
{ "Burlywood4" , 139, 115, 85, 255 } ,
{ "Wheat1" , 255, 231, 186, 255 } ,
{ "Wheat2" , 238, 216, 174, 255 } ,
{ "Wheat3" , 205, 186, 150, 255 } ,
{ "Wheat4" , 139, 126, 102, 255 } ,
{ "Tan1" , 255, 165, 79, 255 } ,
{ "Tan2" , 238, 154, 73, 255 } ,
{ "Tan3" , 205, 133, 63, 255 } ,
{ "Tan4" , 139, 90, 43, 255 } ,
{ "Chocolate1" , 255, 127, 36, 255 } ,
{ "Chocolate2" , 238, 118, 33, 255 } ,
{ "Chocolate3" , 205, 102, 29, 255 } ,
{ "Chocolate4" , 139, 69, 19, 255 } ,
{ "Firebrick1" , 255, 48, 48, 255 } ,
{ "Firebrick2" , 238, 44, 44, 255 } ,
{ "Firebrick3" , 205, 38, 38, 255 } ,
{ "Firebrick4" , 139, 26, 26, 255 } ,
{ "Brown1" , 255, 64, 64, 255 } ,
{ "Brown2" , 238, 59, 59, 255 } ,
{ "Brown3" , 205, 51, 51, 255 } ,
{ "Brown4" , 139, 35, 35, 255 } ,
{ "Salmon1" , 255, 140, 105, 255 } ,
{ "Salmon2" , 238, 130, 98, 255 } ,
{ "Salmon3" , 205, 112, 84, 255 } ,
{ "Salmon4" , 139, 76, 57, 255 } ,
{ "LightSalmon1" , 255, 160, 122, 255 } ,
{ "LightSalmon2" , 238, 149, 114, 255 } ,
{ "LightSalmon3" , 205, 129, 98, 255 } ,
{ "LightSalmon4" , 139, 87, 66, 255 } ,
{ "Orange1" , 255, 165, 0, 255 } ,
{ "Orange2" , 238, 154, 0, 255 } ,
{ "Orange3" , 205, 133, 0, 255 } ,
{ "Orange4" , 139, 90, 0, 255 } ,
{ "DarkOrange1" , 255, 127, 0, 255 } ,
{ "DarkOrange2" , 238, 118, 0, 255 } ,
{ "DarkOrange3" , 205, 102, 0, 255 } ,
{ "DarkOrange4" , 139, 69, 0, 255 } ,
{ "Coral1" , 255, 114, 86, 255 } ,
{ "Coral2" , 238, 106, 80, 255 } ,
{ "Coral3" , 205, 91, 69, 255 } ,
{ "Coral4" , 139, 62, 47, 255 } ,
{ "Tomato1" , 255, 99, 71, 255 } ,
{ "Tomato2" , 238, 92, 66, 255 } ,
{ "Tomato3" , 205, 79, 57, 255 } ,
{ "Tomato4" , 139, 54, 38, 255 } ,
{ "OrangeRed1" , 255, 69, 0, 255 } ,
{ "OrangeRed2" , 238, 64, 0, 255 } ,
{ "OrangeRed3" , 205, 55, 0, 255 } ,
{ "OrangeRed4" , 139, 37, 0, 255 } ,
{ "Red1" , 255, 0, 0, 255 } ,
{ "Red2" , 238, 0, 0, 255 } ,
{ "Red3" , 205, 0, 0, 255 } ,
{ "Red4" , 139, 0, 0, 255 } ,
{ "DeepPink1" , 255, 20, 147, 255 } ,
{ "DeepPink2" , 238, 18, 137, 255 } ,
{ "DeepPink3" , 205, 16, 118, 255 } ,
{ "DeepPink4" , 139, 10, 80, 255 } ,
{ "HotPink1" , 255, 110, 180, 255 } ,
{ "HotPink2" , 238, 106, 167, 255 } ,
{ "HotPink3" , 205, 96, 144, 255 } ,
{ "HotPink4" , 139, 58, 98, 255 } ,
{ "Pink1" , 255, 181, 197, 255 } ,
{ "Pink2" , 238, 169, 184, 255 } ,
{ "Pink3" , 205, 145, 158, 255 } ,
{ "Pink4" , 139, 99, 108, 255 } ,
{ "LightPink1" , 255, 174, 185, 255 } ,
{ "LightPink2" , 238, 162, 173, 255 } ,
{ "LightPink3" , 205, 140, 149, 255 } ,
{ "LightPink4" , 139, 95, 101, 255 } ,
{ "PaleVioletRed1" , 255, 130, 171, 255 } ,
{ "PaleVioletRed2" , 238, 121, 159, 255 } ,
{ "PaleVioletRed3" , 205, 104, 137, 255 } ,
{ "PaleVioletRed4" , 139, 71, 93, 255 } ,
{ "Maroon1" , 255, 52, 179, 255 } ,
{ "Maroon2" , 238, 48, 167, 255 } ,
{ "Maroon3" , 205, 41, 144, 255 } ,
{ "Maroon4" , 139, 28, 98, 255 } ,
{ "VioletRed1" , 255, 62, 150, 255 } ,
{ "VioletRed2" , 238, 58, 140, 255 } ,
{ "VioletRed3" , 205, 50, 120, 255 } ,
{ "VioletRed4" , 139, 34, 82, 255 } ,
{ "Magenta1" , 255, 0, 255, 255 } ,
{ "Magenta2" , 238, 0, 238, 255 } ,
{ "Magenta3" , 205, 0, 205, 255 } ,
{ "Magenta4" , 139, 0, 139, 255 } ,
{ "Orchid1" , 255, 131, 250, 255 } ,
{ "Orchid2" , 238, 122, 233, 255 } ,
{ "Orchid3" , 205, 105, 201, 255 } ,
{ "Orchid4" , 139, 71, 137, 255 } ,
{ "Plum1" , 255, 187, 255, 255 } ,
{ "Plum2" , 238, 174, 238, 255 } ,
{ "Plum3" , 205, 150, 205, 255 } ,
{ "Plum4" , 139, 102, 139, 255 } ,
{ "MediumOrchid1" , 224, 102, 255, 255 } ,
{ "MediumOrchid2" , 209, 95, 238, 255 } ,
{ "MediumOrchid3" , 180, 82, 205, 255 } ,
{ "MediumOrchid4" , 122, 55, 139, 255 } ,
{ "DarkOrchid1" , 191, 62, 255, 255 } ,
{ "DarkOrchid2" , 178, 58, 238, 255 } ,
{ "DarkOrchid3" , 154, 50, 205, 255 } ,
{ "DarkOrchid4" , 104, 34, 139, 255 } ,
{ "purple1" , 155, 48, 255, 255 } ,
{ "purple2" , 145, 44, 238, 255 } ,
{ "purple3" , 125, 38, 205, 255 } ,
{ "purple4" , 85, 26, 139, 255 } ,
{ "MediumPurple1" , 171, 130, 255, 255 } ,
{ "MediumPurple2" , 159, 121, 238, 255 } ,
{ "MediumPurple3" , 137, 104, 205, 255 } ,
{ "MediumPurple4" , 93, 71, 139, 255 } ,
{ "Thistle1" , 255, 225, 255, 255 } ,
{ "Thistle2" , 238, 210, 238, 255 } ,
{ "Thistle3" , 205, 181, 205, 255 } ,
{ "Thistle4" , 139, 123, 139, 255 } ,
{ "Gray0" , 0, 0, 0, 255 } ,
{ "Grey0" , 0, 0, 0, 255 } ,
{ "Gray1" , 3, 3, 3, 255 } ,
{ "Grey1" , 3, 3, 3, 255 } ,
{ "Gray2" , 5, 5, 5, 255 } ,
{ "Grey2" , 5, 5, 5, 255 } ,
{ "Gray3" , 8, 8, 8, 255 } ,
{ "Grey3" , 8, 8, 8, 255 } ,
{ "Gray4" , 10, 10, 10, 255 } ,
{ "Grey4" , 10, 10, 10, 255 } ,
{ "Gray5" , 13, 13, 13, 255 } ,
{ "Grey5" , 13, 13, 13, 255 } ,
{ "Gray6" , 15, 15, 15, 255 } ,
{ "Grey6" , 15, 15, 15, 255 } ,
{ "Gray7" , 18, 18, 18, 255 } ,
{ "Grey7" , 18, 18, 18, 255 } ,
{ "Gray8" , 20, 20, 20, 255 } ,
{ "Grey8" , 20, 20, 20, 255 } ,
{ "Gray9" , 23, 23, 23, 255 } ,
{ "Grey9" , 23, 23, 23, 255 } ,
{ "Gray10" , 26, 26, 26, 255 } ,
{ "Grey10" , 26, 26, 26, 255 } ,
{ "Gray11" , 28, 28, 28, 255 } ,
{ "Grey11" , 28, 28, 28, 255 } ,
{ "Gray12" , 31, 31, 31, 255 } ,
{ "Grey12" , 31, 31, 31, 255 } ,
{ "Gray13" , 33, 33, 33, 255 } ,
{ "Grey13" , 33, 33, 33, 255 } ,
{ "Gray14" , 36, 36, 36, 255 } ,
{ "Grey14" , 36, 36, 36, 255 } ,
{ "Gray15" , 38, 38, 38, 255 } ,
{ "Grey15" , 38, 38, 38, 255 } ,
{ "Gray16" , 41, 41, 41, 255 } ,
{ "Grey16" , 41, 41, 41, 255 } ,
{ "Gray17" , 43, 43, 43, 255 } ,
{ "Grey17" , 43, 43, 43, 255 } ,
{ "Gray18" , 46, 46, 46, 255 } ,
{ "Grey18" , 46, 46, 46, 255 } ,
{ "Gray19" , 48, 48, 48, 255 } ,
{ "Grey19" , 48, 48, 48, 255 } ,
{ "Gray20" , 51, 51, 51, 255 } ,
{ "Grey20" , 51, 51, 51, 255 } ,
{ "Gray21" , 54, 54, 54, 255 } ,
{ "Grey21" , 54, 54, 54, 255 } ,
{ "Gray22" , 56, 56, 56, 255 } ,
{ "Grey22" , 56, 56, 56, 255 } ,
{ "Gray23" , 59, 59, 59, 255 } ,
{ "Grey23" , 59, 59, 59, 255 } ,
{ "Gray24" , 61, 61, 61, 255 } ,
{ "Grey24" , 61, 61, 61, 255 } ,
{ "Gray25" , 64, 64, 64, 255 } ,
{ "Grey25" , 64, 64, 64, 255 } ,
{ "Gray26" , 66, 66, 66, 255 } ,
{ "Grey26" , 66, 66, 66, 255 } ,
{ "Gray27" , 69, 69, 69, 255 } ,
{ "Grey27" , 69, 69, 69, 255 } ,
{ "Gray28" , 71, 71, 71, 255 } ,
{ "Grey28" , 71, 71, 71, 255 } ,
{ "Gray29" , 74, 74, 74, 255 } ,
{ "Grey29" , 74, 74, 74, 255 } ,
{ "Gray30" , 77, 77, 77, 255 } ,
{ "Grey30" , 77, 77, 77, 255 } ,
{ "Gray31" , 79, 79, 79, 255 } ,
{ "Grey31" , 79, 79, 79, 255 } ,
{ "Gray32" , 82, 82, 82, 255 } ,
{ "Grey32" , 82, 82, 82, 255 } ,
{ "Gray33" , 84, 84, 84, 255 } ,
{ "Grey33" , 84, 84, 84, 255 } ,
{ "Gray34" , 87, 87, 87, 255 } ,
{ "Grey34" , 87, 87, 87, 255 } ,
{ "Gray35" , 89, 89, 89, 255 } ,
{ "Grey35" , 89, 89, 89, 255 } ,
{ "Gray36" , 92, 92, 92, 255 } ,
{ "Grey36" , 92, 92, 92, 255 } ,
{ "Gray37" , 94, 94, 94, 255 } ,
{ "Grey37" , 94, 94, 94, 255 } ,
{ "Gray38" , 97, 97, 97, 255 } ,
{ "Grey38" , 97, 97, 97, 255 } ,
{ "Gray39" , 99, 99, 99, 255 } ,
{ "Grey39" , 99, 99, 99, 255 } ,
{ "Gray40" , 102, 102, 102, 255 } ,
{ "Grey40" , 102, 102, 102, 255 } ,
{ "Gray41" , 105, 105, 105, 255 } ,
{ "Grey41" , 105, 105, 105, 255 } ,
{ "Gray42" , 107, 107, 107, 255 } ,
{ "Grey42" , 107, 107, 107, 255 } ,
{ "Gray43" , 110, 110, 110, 255 } ,
{ "Grey43" , 110, 110, 110, 255 } ,
{ "Gray44" , 112, 112, 112, 255 } ,
{ "Grey44" , 112, 112, 112, 255 } ,
{ "Gray45" , 115, 115, 115, 255 } ,
{ "Grey45" , 115, 115, 115, 255 } ,
{ "Gray46" , 117, 117, 117, 255 } ,
{ "Grey46" , 117, 117, 117, 255 } ,
{ "Gray47" , 120, 120, 120, 255 } ,
{ "Grey47" , 120, 120, 120, 255 } ,
{ "Gray48" , 122, 122, 122, 255 } ,
{ "Grey48" , 122, 122, 122, 255 } ,
{ "Gray49" , 125, 125, 125, 255 } ,
{ "Grey49" , 125, 125, 125, 255 } ,
{ "Gray50" , 127, 127, 127, 255 } ,
{ "Grey50" , 127, 127, 127, 255 } ,
{ "Gray51" , 130, 130, 130, 255 } ,
{ "Grey51" , 130, 130, 130, 255 } ,
{ "Gray52" , 133, 133, 133, 255 } ,
{ "Grey52" , 133, 133, 133, 255 } ,
{ "Gray53" , 135, 135, 135, 255 } ,
{ "Grey53" , 135, 135, 135, 255 } ,
{ "Gray54" , 138, 138, 138, 255 } ,
{ "Grey54" , 138, 138, 138, 255 } ,
{ "Gray55" , 140, 140, 140, 255 } ,
{ "Grey55" , 140, 140, 140, 255 } ,
{ "Gray56" , 143, 143, 143, 255 } ,
{ "Grey56" , 143, 143, 143, 255 } ,
{ "Gray57" , 145, 145, 145, 255 } ,
{ "Grey57" , 145, 145, 145, 255 } ,
{ "Gray58" , 148, 148, 148, 255 } ,
{ "Grey58" , 148, 148, 148, 255 } ,
{ "Gray59" , 150, 150, 150, 255 } ,
{ "Grey59" , 150, 150, 150, 255 } ,
{ "Gray60" , 153, 153, 153, 255 } ,
{ "Grey60" , 153, 153, 153, 255 } ,
{ "Gray61" , 156, 156, 156, 255 } ,
{ "Grey61" , 156, 156, 156, 255 } ,
{ "Gray62" , 158, 158, 158, 255 } ,
{ "Grey62" , 158, 158, 158, 255 } ,
{ "Gray63" , 161, 161, 161, 255 } ,
{ "Grey63" , 161, 161, 161, 255 } ,
{ "Gray64" , 163, 163, 163, 255 } ,
{ "Grey64" , 163, 163, 163, 255 } ,
{ "Gray65" , 166, 166, 166, 255 } ,
{ "Grey65" , 166, 166, 166, 255 } ,
{ "Gray66" , 168, 168, 168, 255 } ,
{ "Grey66" , 168, 168, 168, 255 } ,
{ "Gray67" , 171, 171, 171, 255 } ,
{ "Grey67" , 171, 171, 171, 255 } ,
{ "Gray68" , 173, 173, 173, 255 } ,
{ "Grey68" , 173, 173, 173, 255 } ,
{ "Gray69" , 176, 176, 176, 255 } ,
{ "Grey69" , 176, 176, 176, 255 } ,
{ "Gray70" , 179, 179, 179, 255 } ,
{ "Grey70" , 179, 179, 179, 255 } ,
{ "Gray71" , 181, 181, 181, 255 } ,
{ "Grey71" , 181, 181, 181, 255 } ,
{ "Gray72" , 184, 184, 184, 255 } ,
{ "Grey72" , 184, 184, 184, 255 } ,
{ "Gray73" , 186, 186, 186, 255 } ,
{ "Grey73" , 186, 186, 186, 255 } ,
{ "Gray74" , 189, 189, 189, 255 } ,
{ "Grey74" , 189, 189, 189, 255 } ,
{ "Gray75" , 191, 191, 191, 255 } ,
{ "Grey75" , 191, 191, 191, 255 } ,
{ "Gray76" , 194, 194, 194, 255 } ,
{ "Grey76" , 194, 194, 194, 255 } ,
{ "Gray77" , 196, 196, 196, 255 } ,
{ "Grey77" , 196, 196, 196, 255 } ,
{ "Gray78" , 199, 199, 199, 255 } ,
{ "Grey78" , 199, 199, 199, 255 } ,
{ "Gray79" , 201, 201, 201, 255 } ,
{ "Grey79" , 201, 201, 201, 255 } ,
{ "Gray80" , 204, 204, 204, 255 } ,
{ "Grey80" , 204, 204, 204, 255 } ,
{ "Gray81" , 207, 207, 207, 255 } ,
{ "Grey81" , 207, 207, 207, 255 } ,
{ "Gray82" , 209, 209, 209, 255 } ,
{ "Grey82" , 209, 209, 209, 255 } ,
{ "Gray83" , 212, 212, 212, 255 } ,
{ "Grey83" , 212, 212, 212, 255 } ,
{ "Gray84" , 214, 214, 214, 255 } ,
{ "Grey84" , 214, 214, 214, 255 } ,
{ "Gray85" , 217, 217, 217, 255 } ,
{ "Grey85" , 217, 217, 217, 255 } ,
{ "Gray86" , 219, 219, 219, 255 } ,
{ "Grey86" , 219, 219, 219, 255 } ,
{ "Gray87" , 222, 222, 222, 255 } ,
{ "Grey87" , 222, 222, 222, 255 } ,
{ "Gray88" , 224, 224, 224, 255 } ,
{ "Grey88" , 224, 224, 224, 255 } ,
{ "Gray89" , 227, 227, 227, 255 } ,
{ "Grey89" , 227, 227, 227, 255 } ,
{ "Gray90" , 229, 229, 229, 255 } ,
{ "Grey90" , 229, 229, 229, 255 } ,
{ "Gray91" , 232, 232, 232, 255 } ,
{ "Grey91" , 232, 232, 232, 255 } ,
{ "Gray92" , 235, 235, 235, 255 } ,
{ "Grey92" , 235, 235, 235, 255 } ,
{ "Gray93" , 237, 237, 237, 255 } ,
{ "Grey93" , 237, 237, 237, 255 } ,
{ "Gray94" , 240, 240, 240, 255 } ,
{ "Grey94" , 240, 240, 240, 255 } ,
{ "Gray95" , 242, 242, 242, 255 } ,
{ "Grey95" , 242, 242, 242, 255 } ,
{ "Gray96" , 245, 245, 245, 255 } ,
{ "Grey96" , 245, 245, 245, 255 } ,
{ "Gray97" , 247, 247, 247, 255 } ,
{ "Grey97" , 247, 247, 247, 255 } ,
{ "Gray98" , 250, 250, 250, 255 } ,
{ "Grey98" , 250, 250, 250, 255 } ,
{ "Gray99" , 252, 252, 252, 255 } ,
{ "Grey99" , 252, 252, 252, 255 } ,
{ "Gray100" , 255, 255, 255, 255 } ,
{ "Grey100" , 255, 255, 255, 255 } ,
{ "DarkGrey" , 169, 169, 169, 255 } ,
{ "DarkGray" , 169, 169, 169, 255 } ,
{ "DarkBlue" , 0 , 0, 139, 255 } ,
{ "DarkCyan" , 0 , 139, 139, 255 } ,
{ "DarkMagenta" , 139, 0, 139, 255 } ,
{ "DarkRed" , 139, 0, 0, 255 } ,
{ "LightGreen" , 144, 238, 144, 255 } ,
{ 0 , 0 , 0, 0, 255 }
} ;
int GetColorForString(StringX4Int SX4I[], int alpha, const char *string,
int *FlagError);
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <string>
#include <string.h>
#include <stdlib.h>
#include "GmshConfig.h"
#include "GmshDefines.h"
#include "GmshVersion.h"
#include "GmshMessage.h"
#include "OpenFile.h"
#include "CommandLine.h"
#include "Context.h"
#include "Options.h"
#include "GModel.h"
#include "CreateFile.h"
#include "OS.h"
#if defined(HAVE_FLTK)
#include <FL/Fl.H>
#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1) && (FL_PATCH_VERSION > 6)
// OK
#elif (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 3)
// also OK
#else
#error "Gmsh requires FLTK >= 1.1.7 or FLTK 1.3.x"
#endif
#endif
#if defined(HAVE_POST)
#include "PView.h"
#endif
int GetGmshMajorVersion(){ return GMSH_MAJOR_VERSION; }
int GetGmshMinorVersion(){ return GMSH_MINOR_VERSION; }
int GetGmshPatchVersion(){ return GMSH_PATCH_VERSION; }
const char *GetGmshExtraVersion(){ return GMSH_EXTRA_VERSION; }
const char *GetGmshVersion(){ return GMSH_VERSION; }
const char *GetGmshBuildDate(){ return GMSH_DATE; }
const char *GetGmshBuildHost(){ return GMSH_HOST; }
const char *GetGmshPackager(){ return GMSH_PACKAGER; }
const char *GetGmshBuildOS(){ return GMSH_OS; }
const char *GetGmshShortLicense(){ return GMSH_SHORT_LICENSE; }
const char *GetGmshBuildOptions(){ return GMSH_CONFIG_OPTIONS; }
void PrintUsage(const char *name)
{
// If you make changes in this routine, please also change the
// texinfo documentation (doc/texinfo/gmsh.texi) and the man page
// (doc/gmsh.1)
Msg::Direct("Usage: %s [options] [files]", name);
Msg::Direct("Geometry options:");
Msg::Direct(" -0 Output unrolled geometry, then exit");
Msg::Direct(" -tol float Set geometrical tolerance");
Msg::Direct(" -match Match geometries and meshes");
Msg::Direct("Mesh options:");
Msg::Direct(" -1, -2, -3 Perform 1D, 2D or 3D mesh generation, then exit");
Msg::Direct(" -refine Perform uniform mesh refinement, then exit");
Msg::Direct(" -part int Partition after batch mesh generation");
Msg::Direct(" -partWeight <tri|quad|tet|prism|hex> = int Weight of a triangle/... during partitioning");
Msg::Direct(" -renumber Renumber the mesh elements after batch mesh generation");
Msg::Direct(" -saveall Save all elements (discard physical group definitions)");
Msg::Direct(" -o file Specify output file name");
Msg::Direct(" -bin Use binary format when available");
Msg::Direct(" -parametric Save vertices with their parametric coordinates");
Msg::Direct(" -numsubedges Set the number of subdivisions when displaying high order elements");
Msg::Direct(" -algo string Select mesh algorithm (meshadapt, del2d, front2d, delquad, del3d, front3d, mmg3d)");
Msg::Direct(" -smooth int Set number of mesh smoothing steps");
Msg::Direct(" -order int Set mesh order (1, ..., 5)");
Msg::Direct(" -optimize[_netgen] Optimize quality of tetrahedral elements");
Msg::Direct(" -optimize_hom Optimize higher order meshes (in 2D)");
Msg::Direct(" -hom_nometric Don't use the metric-based high-order mesh generation.");
Msg::Direct(" -optimize_lloyd Optimize 2D meshes using Lloyd algorithm");
Msg::Direct(" -clscale float Set global mesh element size scaling factor");
Msg::Direct(" -clmin float Set minimum mesh element size");
Msg::Direct(" -clmax float Set maximum mesh element size");
Msg::Direct(" -anisoMax float Set maximum anisotropy (only used in bamg for now)");
Msg::Direct(" -smoothRatio float Set smoothing ration between mesh sizes at nodes of a same edge (only used in bamg)");
Msg::Direct(" -clcurv Automatically compute element sizes from curvatures");
Msg::Direct(" -epslc1d Set the accuracy of the evaluation of the LCFIELD for 1D mesh");
Msg::Direct(" -swapangle Set the threshold angle (in degree) between two adjacent faces");
Msg::Direct(" below which a swap is allowed");
Msg::Direct(" -rand float Set random perturbation factor");
Msg::Direct(" -bgm file Load background mesh from file");
Msg::Direct(" -check Perform various consistency checks on mesh");
Msg::Direct(" -mpass int Do several passes on the mesh for complex backround fields");
#if defined(HAVE_FLTK)
Msg::Direct("Post-processing options:");
Msg::Direct(" -link int Select link mode between views (0, 1, 2, 3, 4)");
Msg::Direct(" -combine Combine views having identical names into multi-time-step views");
Msg::Direct("Display options:");
Msg::Direct(" -n Hide all meshes and post-processing views on startup");
Msg::Direct(" -nodb Disable double buffering");
Msg::Direct(" -fontsize int Specify the font size for the GUI");
Msg::Direct(" -theme string Specify FLTK GUI theme");
Msg::Direct(" -display string Specify display");
#endif
Msg::Direct("Other options:");
Msg::Direct(" - Parse input files, then exit");
#if defined(HAVE_FLTK)
Msg::Direct(" -a, -g, -m, -s, -p Start in automatic, geometry, mesh, solver or post-processing mode");
#endif
Msg::Direct(" -pid Print process id on stdout");
Msg::Direct(" -listen Always listen to incoming connection requests");
Msg::Direct(" -watch pattern Pattern of files to merge as they become available");
Msg::Direct(" -v int Set verbosity level");
Msg::Direct(" -nopopup Don't popup dialog windows in scripts");
Msg::Direct(" -string \"string\" Parse option string at startup");
Msg::Direct(" -option file Parse option file at startup");
Msg::Direct(" -convert files Convert files into latest binary formats, then exit");
Msg::Direct(" -version Show version number");
Msg::Direct(" -info Show detailed version information");
Msg::Direct(" -help Show this message");
}
void GetOptions(int argc, char *argv[])
{
// print messages on terminal
int terminal = CTX::instance()->terminal;
CTX::instance()->terminal = 1;
#if defined(HAVE_PARSER)
// Parse session and option files
ParseFile(CTX::instance()->homeDir + CTX::instance()->sessionFileName, true);
ParseFile(CTX::instance()->homeDir + CTX::instance()->optionsFileName, true);
#endif
// Get command line options
int i = 1;
while(i < argc) {
if(argv[i][0] == '-') {
if(!strcmp(argv[i] + 1, "")) {
CTX::instance()->batch = -99;
i++;
}
else if(!strcmp(argv[i] + 1, "socket")) {
i++;
if(argv[i])
Msg::InitClient(argv[i++]);
else
Msg::Fatal("Missing string");
CTX::instance()->batch = -3;
}
else if(!strcmp(argv[i] + 1, "check")) {
CTX::instance()->batch = -2;
i++;
}
else if(!strcmp(argv[i] + 1, "0")) {
CTX::instance()->batch = -1;
i++;
}
else if(!strcmp(argv[i] + 1, "1")) {
CTX::instance()->batch = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "2")) {
CTX::instance()->batch = 2;
i++;
}
else if(!strcmp(argv[i] + 1, "3")) {
CTX::instance()->batch = 3;
i++;
}
else if(!strcmp(argv[i] + 1, "4")) {
CTX::instance()->batch = 4;
i++;
}
else if(!strcmp(argv[i] + 1, "refine")) {
CTX::instance()->batch = 5;
i++;
}
else if(!strcmp(argv[i] + 1, "renumber")) {
CTX::instance()->batchAfterMesh = 1;
CTX::instance()->partitionOptions.renumber = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "part")) {
i++;
if(argv[i]){
CTX::instance()->batchAfterMesh = 1 ;
opt_mesh_partition_num(0, GMSH_SET, atoi(argv[i++]));
}
else
Msg::Fatal("Missing number");
}
else if (!strcmp(argv[i] + 1,"partWeight")) {
i++;
bool check = true;
opt_mesh_partition_partitioner(0,GMSH_SET,2); // set Metis partitioner
opt_mesh_partition_metis_algorithm(0,GMSH_SET,3); // set partGraphKWay w/ weights
while (check) {
if (argv[i]) {
if (!strcmp(argv[i],"triangle")) {
i++;
opt_mesh_partition_tri_weight(0,GMSH_SET,atoi(argv[i]));
}
else if (!strcmp(argv[i],"quad")) {
i++;
opt_mesh_partition_qua_weight(0,GMSH_SET,atoi(argv[i]));
}
else if (!strcmp(argv[i],"tet")) {
i++;
opt_mesh_partition_tet_weight(0,GMSH_SET,atoi(argv[i]));
}
else if (!strcmp(argv[i],"prism")) {
i++;
opt_mesh_partition_pri_weight(0,GMSH_SET,atoi(argv[i]));
}
else if (!strcmp(argv[i],"pyramid")) {
i++;
opt_mesh_partition_pyr_weight(0,GMSH_SET,atoi(argv[i]));
}
else if (!strcmp(argv[i],"hex")) {
i++;
opt_mesh_partition_hex_weight(0,GMSH_SET,atoi(argv[i]));
}
else check = false;
i++;
}
else check = false;
}
}
else if(!strcmp(argv[i] + 1, "new")) {
CTX::instance()->files.push_back("-new");
i++;
}
else if(!strcmp(argv[i] + 1, "pid")) {
fprintf(stdout, "%d\n", GetProcessId());
fflush(stdout);
i++;
}
else if(!strcmp(argv[i] + 1, "a")) {
CTX::instance()->initialContext = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "g")) {
CTX::instance()->initialContext = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "m")) {
CTX::instance()->initialContext = 2;
i++;
}
else if(!strcmp(argv[i] + 1, "s")) {
CTX::instance()->initialContext = 3;
i++;
}
else if(!strcmp(argv[i] + 1, "p")) {
CTX::instance()->initialContext = 4;
i++;
}
else if(!strcmp(argv[i] + 1, "saveall")) {
CTX::instance()->mesh.saveAll = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "switch_tags")) {
CTX::instance()->mesh.switchElementTags = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "optimize")) {
CTX::instance()->mesh.optimize = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "optimize_netgen")) {
CTX::instance()->mesh.optimizeNetgen = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "optimize_hom")) {
i++;
opt_mesh_smooth_internal_edges(0, GMSH_SET, 1);
}
else if(!strcmp(argv[i] + 1, "hom_nometric")) {
i++;
opt_mesh_hom_no_metric(0, GMSH_SET, 1);
}
else if(!strcmp(argv[i] + 1, "optimize_lloyd")) {
i++;
if(argv[i])
CTX::instance()->mesh.optimizeLloyd = atoi(argv[i++]);
else
Msg::Fatal("Missing number of lloyd iterations");
}
else if(!strcmp(argv[i] + 1, "nopopup")) {
CTX::instance()->noPopup = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "watch")) {
i++;
if(argv[i]){
std::string tmp = argv[i++];
if(tmp.size() > 2 && tmp[0] == '"' && tmp[tmp.size() - 1] == '"')
CTX::instance()->watchFilePattern = tmp.substr(1, tmp.size() - 2);
else
CTX::instance()->watchFilePattern = tmp;
}
else
Msg::Fatal("Missing string");
}
else if(!strcmp(argv[i] + 1, "string")) {
i++;
if(argv[i])
ParseString(argv[i++]);
else
Msg::Fatal("Missing string");
}
else if(!strcmp(argv[i] + 1, "option")) {
i++;
if(argv[i])
ParseFile(argv[i++], true);
else
Msg::Fatal("Missing file name");
}
else if(!strcmp(argv[i] + 1, "o")) {
i++;
if(argv[i])
CTX::instance()->outputFileName = argv[i++];
else
Msg::Fatal("Missing file name");
}
else if(!strcmp(argv[i] + 1, "anisoMax")) {
i++;
if(argv[i])
CTX::instance()->mesh.anisoMax = atof(argv[i++]);
else
Msg::Fatal("Missing anisotropy ratio");
}
else if(!strcmp(argv[i] + 1, "smoothRatio")) {
i++;
if(argv[i])
CTX::instance()->mesh.smoothRatio = atof(argv[i++]);
else
Msg::Fatal("Missing smooth ratio");
}
else if(!strcmp(argv[i] + 1, "bgm")) {
i++;
if(argv[i])
CTX::instance()->bgmFileName = argv[i++];
else
Msg::Fatal("Missing file name");
}
else if(!strcmp(argv[i] + 1, "nw")) {
i++;
if(argv[i])
CTX::instance()->numWindows = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "nt")) {
i++;
if(argv[i])
CTX::instance()->numTiles = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "convert")) {
i++;
CTX::instance()->batch = 1;
while(i < argc) {
std::string fileName = std::string(argv[i]) + "_new";
#if defined(HAVE_POST)
unsigned int n = PView::list.size();
#endif
OpenProject(argv[i]);
#if defined(HAVE_POST)
// convert post-processing views to latest binary format
for(unsigned int j = n; j < PView::list.size(); j++)
PView::list[j]->write(fileName, 1, (j == n) ? false : true);
#endif
// convert mesh to latest binary format
if(GModel::current()->getMeshStatus() > 0){
CTX::instance()->mesh.mshFileVersion = 2.0;
CTX::instance()->mesh.binary = 1;
CreateOutputFile(fileName, FORMAT_MSH);
}
i++;
}
Msg::Exit(0);
}
else if(!strcmp(argv[i] + 1, "tol")) {
i++;
if(argv[i])
CTX::instance()->geom.tolerance = atof(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "match")) {
i++;
CTX::instance()->geom.matchGeomAndMesh = 1;
}
else if(!strcmp(argv[i] + 1, "scale")) {
i++;
if(argv[i])
CTX::instance()->geom.scalingFactor = atof(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "meshscale")) {
i++;
if(argv[i])
CTX::instance()->mesh.scalingFactor = atof(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "rand")) {
i++;
if(argv[i])
CTX::instance()->mesh.randFactor = atof(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "clscale")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.lcFactor = atof(argv[i++]);
if(CTX::instance()->mesh.lcFactor <= 0.0)
Msg::Fatal("Mesh element size factor must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "clmin")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.lcMin = atof(argv[i++]);
if(CTX::instance()->mesh.lcMin <= 0.0)
Msg::Fatal("Minimum length size must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "clmax")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.lcMax = atof(argv[i++]);
if(CTX::instance()->mesh.lcMax <= 0.0)
Msg::Fatal("Maximum length size must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "mpass")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.multiplePasses = atoi(argv[i++]);
if(CTX::instance()->mesh.multiplePasses <= 0)
Msg::Fatal("Number of Mesh Passes must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "edgelmin")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.toleranceEdgeLength = atof(argv[i++]);
if(CTX::instance()->mesh.toleranceEdgeLength <= 0.0)
Msg::Fatal("Tolerance for model edge length must be > 0 (here %g)",
CTX::instance()->mesh.toleranceEdgeLength);
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "epslc1d")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.lcIntegrationPrecision = atof(argv[i++]);
if(CTX::instance()->mesh.lcIntegrationPrecision <= 0.0)
Msg::Fatal("Integration accuracy must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "swapangle")) {
i++;
if(argv[i]) {
CTX::instance()->mesh.allowSwapEdgeAngle = atof(argv[i++]);
if(CTX::instance()->mesh.allowSwapEdgeAngle <= 0.0)
Msg::Fatal("Threshold angle for edge swap must be > 0");
}
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "clcurv")) {
CTX::instance()->mesh.lcFromCurvature = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "smooth")) {
i++;
if(argv[i])
CTX::instance()->mesh.nbSmoothing = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "order") || !strcmp(argv[i] + 1, "degree")) {
i++;
if(argv[i])
opt_mesh_order(0, GMSH_SET, atof(argv[i++]));
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "numsubedges")) {
i++;
if(argv[i])
opt_mesh_num_sub_edges(0, GMSH_SET, atof(argv[i++]));
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "statreport")) {
i++;
CTX::instance()->createAppendMeshStatReport = 1;
if(argv[i])
CTX::instance()->meshStatReportFileName = argv[i++];
else
Msg::Fatal("Missing argument");
}
else if(!strcmp(argv[i] + 1, "append_statreport")) {
i++;
CTX::instance()->createAppendMeshStatReport = 2;
if(argv[i])
CTX::instance()->meshStatReportFileName = argv[i++];
else
Msg::Fatal("Missing argument");
}
else if(!strcmp(argv[i] + 1, "bin")) {
i++;
CTX::instance()->mesh.binary = 1;
}
else if(!strcmp(argv[i] + 1, "parametric")) {
i++;
CTX::instance()->mesh.saveParametric = 1;
}
else if(!strcmp(argv[i] + 1, "algo")) {
i++;
if(argv[i]) {
if(!strncmp(argv[i], "auto", 4))
CTX::instance()->mesh.algo2d = ALGO_2D_AUTO;
else if(!strncmp(argv[i], "meshadapt", 9) || !strncmp(argv[i], "iso", 3))
CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT;
else if(!strncmp(argv[i], "bds", 3))
CTX::instance()->mesh.algo2d = ALGO_2D_MESHADAPT_OLD;
else if(!strncmp(argv[i], "del2d", 5) || !strncmp(argv[i], "tri", 3))
CTX::instance()->mesh.algo2d = ALGO_2D_DELAUNAY;
else if(!strncmp(argv[i], "delquad", 5) || !strncmp(argv[i], "tri", 3))
CTX::instance()->mesh.algo2d = ALGO_2D_FRONTAL_QUAD;
else if(!strncmp(argv[i], "front2d", 7) || !strncmp(argv[i], "frontal", 7))
CTX::instance()->mesh.algo2d = ALGO_2D_FRONTAL;
else if(!strncmp(argv[i], "bamg",4))
CTX::instance()->mesh.algo2d = ALGO_2D_BAMG;
else if(!strncmp(argv[i], "del3d", 5) || !strncmp(argv[i], "tetgen", 6))
CTX::instance()->mesh.algo3d = ALGO_3D_DELAUNAY;
else if(!strncmp(argv[i], "front3d", 7) || !strncmp(argv[i], "netgen", 6))
CTX::instance()->mesh.algo3d = ALGO_3D_FRONTAL;
else if(!strncmp(argv[i], "mmg3d", 5))
CTX::instance()->mesh.algo3d = ALGO_3D_MMG3D;
else if(!strncmp(argv[i], "delfr3d", 7))
CTX::instance()->mesh.algo3d = ALGO_3D_FRONTAL_DEL;
else if(!strncmp(argv[i], "delhex3d", 8))
CTX::instance()->mesh.algo3d = ALGO_3D_FRONTAL_HEX;
else
Msg::Fatal("Unknown mesh algorithm");
i++;
}
else
Msg::Fatal("Missing algorithm");
}
else if(!strcmp(argv[i] + 1, "format") || !strcmp(argv[i] + 1, "f")) {
i++;
if(argv[i]) {
if(!strcmp(argv[i], "auto")){
CTX::instance()->mesh.fileFormat = FORMAT_AUTO;
}
else if(!strcmp(argv[i], "msh1")){
CTX::instance()->mesh.fileFormat = FORMAT_MSH;
CTX::instance()->mesh.mshFileVersion = 1.0;
}
else if(!strcmp(argv[i], "msh2")){
CTX::instance()->mesh.fileFormat = FORMAT_MSH;
CTX::instance()->mesh.mshFileVersion = 2.0;
}
else if(!strcmp(argv[i], "msh"))
CTX::instance()->mesh.fileFormat = FORMAT_MSH;
else if(!strcmp(argv[i], "unv"))
CTX::instance()->mesh.fileFormat = FORMAT_UNV;
else if(!strcmp(argv[i], "vrml"))
CTX::instance()->mesh.fileFormat = FORMAT_VRML;
else if(!strcmp(argv[i], "ply2"))
CTX::instance()->mesh.fileFormat = FORMAT_PLY2;
else if(!strcmp(argv[i], "stl"))
CTX::instance()->mesh.fileFormat = FORMAT_STL;
else if(!strcmp(argv[i], "mesh"))
CTX::instance()->mesh.fileFormat = FORMAT_MESH;
else if(!strcmp(argv[i], "bdf"))
CTX::instance()->mesh.fileFormat = FORMAT_BDF;
else if(!strcmp(argv[i], "p3d"))
CTX::instance()->mesh.fileFormat = FORMAT_P3D;
else if(!strcmp(argv[i], "cgns"))
CTX::instance()->mesh.fileFormat = FORMAT_CGNS;
else if(!strcmp(argv[i], "diff"))
CTX::instance()->mesh.fileFormat = FORMAT_DIFF;
else if(!strcmp(argv[i], "med"))
CTX::instance()->mesh.fileFormat = FORMAT_MED;
else if(!strcmp(argv[i], "ir3"))
CTX::instance()->mesh.fileFormat = FORMAT_IR3;
else
Msg::Fatal("Unknown mesh format");
i++;
}
else
Msg::Fatal("Missing format");
}
else if(!strcmp(argv[i] + 1, "listen")) {
CTX::instance()->solver.listen = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "version") || !strcmp(argv[i] + 1, "-version")) {
fprintf(stderr, "%s\n", GMSH_VERSION);
Msg::Exit(0);
}
else if(!strcmp(argv[i] + 1, "info") || !strcmp(argv[i] + 1, "-info")) {
fprintf(stderr, "Version : %s\n", GMSH_VERSION);
#if defined(HAVE_FLTK)
fprintf(stderr, "GUI toolkit : FLTK %d.%d.%d\n", FL_MAJOR_VERSION,
FL_MINOR_VERSION, FL_PATCH_VERSION);
#else
fprintf(stderr, "GUI toolkit : none\n");
#endif
fprintf(stderr, "License : %s\n", GMSH_SHORT_LICENSE);
fprintf(stderr, "Build OS : %s\n", GMSH_OS);
fprintf(stderr, "Build options :%s\n", GMSH_CONFIG_OPTIONS);
fprintf(stderr, "Build date : %s\n", GMSH_DATE);
fprintf(stderr, "Build host : %s\n", GMSH_HOST);
fprintf(stderr, "Packager : %s\n", GMSH_PACKAGER);
fprintf(stderr, "Web site : http://www.geuz.org/gmsh/\n");
fprintf(stderr, "Mailing list : gmsh@geuz.org\n");
Msg::Exit(0);
}
else if(!strcmp(argv[i] + 1, "help") || !strcmp(argv[i] + 1, "-help")) {
fprintf(stderr, "Gmsh, a 3D mesh generator with pre- and post-processing facilities\n");
fprintf(stderr, "Copyright (C) 1997-2011 Christophe Geuzaine and Jean-Francois Remacle\n");
PrintUsage(argv[0]);
Msg::Exit(0);
}
else if(!strcmp(argv[i] + 1, "v")) {
i++;
if(argv[i])
Msg::SetVerbosity(atoi(argv[i++]));
else
Msg::Fatal("Missing number");
}
#if defined(HAVE_FLTK)
else if(!strcmp(argv[i] + 1, "term")) {
terminal = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "dual")) {
CTX::instance()->mesh.dual = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "voronoi")) {
CTX::instance()->mesh.voronoi = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "noview")) {
opt_view_visible(0, GMSH_SET, 0);
i++;
}
else if(!strcmp(argv[i] + 1, "nomesh")) {
opt_mesh_points(0, GMSH_SET, 0.);
opt_mesh_lines(0, GMSH_SET, 0.);
opt_mesh_surfaces_edges(0, GMSH_SET, 0.);
opt_mesh_surfaces_faces(0, GMSH_SET, 0.);
opt_mesh_volumes_edges(0, GMSH_SET, 0.);
opt_mesh_volumes_faces(0, GMSH_SET, 0.);
i++;
}
else if(!strcmp(argv[i] + 1, "n")) {
opt_view_visible(0, GMSH_SET, 0);
opt_mesh_points(0, GMSH_SET, 0.);
opt_mesh_lines(0, GMSH_SET, 0.);
opt_mesh_surfaces_edges(0, GMSH_SET, 0.);
opt_mesh_surfaces_faces(0, GMSH_SET, 0.);
opt_mesh_volumes_edges(0, GMSH_SET, 0.);
opt_mesh_volumes_faces(0, GMSH_SET, 0.);
i++;
}
else if(!strcmp(argv[i] + 1, "link")) {
i++;
if(argv[i])
CTX::instance()->post.link = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "smoothview")) {
CTX::instance()->post.smooth = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "combine")) {
CTX::instance()->post.combineTime = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nodb")) {
CTX::instance()->db = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "fontsize")) {
i++;
if(argv[i])
CTX::instance()->fontSize = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "deltafontsize")) {
i++;
if(argv[i])
CTX::instance()->deltaFontSize = atoi(argv[i++]);
else
Msg::Fatal("Missing number");
}
else if(!strcmp(argv[i] + 1, "theme") || !strcmp(argv[i] + 1, "scheme")) {
i++;
if(argv[i])
CTX::instance()->guiTheme = argv[i++];
else
Msg::Fatal("Missing argument");
}
else if(!strcmp(argv[i] + 1, "display")) {
i++;
if(argv[i])
CTX::instance()->display = argv[i++];
else
Msg::Fatal("Missing argument");
}
#endif
#if defined(__APPLE__)
else if(!strncmp(argv[i] + 1, "psn", 3)) {
// The Mac Finder launches programs with a special command
// line argument of the form -psn_XXX: just ignore it silently
// (and don't exit!)
i++;
}
#endif
else {
Msg::Error("Unknown option '%s'", argv[i]);
PrintUsage(argv[0]);
Msg::Exit(1);
}
}
else {
CTX::instance()->files.push_back(argv[i++]);
}
}
if(CTX::instance()->files.empty()){
std::string base = (getenv("PWD") ? "" : CTX::instance()->homeDir);
GModel::current()->setFileName(base + CTX::instance()->defaultFileName);
}
else
GModel::current()->setFileName(CTX::instance()->files[0]);
CTX::instance()->terminal = terminal;
}
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _COMMAND_LINE_H_
#define _COMMAND_LINE_H_
int GetGmshMajorVersion();
int GetGmshMinorVersion();
int GetGmshPatchVersion();
const char *GetGmshExtraVersion();
const char *GetGmshVersion();
const char *GetGmshBuildDate();
const char *GetGmshBuildHost();
const char *GetGmshPackager();
const char *GetGmshBuildOS();
const char *GetGmshShortLicense();
const char *GetGmshBuildOptions();
void PrintUsage(const char *name);
void GetOptions(int argc, char *argv[]);
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <sstream>
#include "GmshConfig.h"
#include "GmshMessage.h"
#include "ConnectionManager.h"
#include "StringUtils.h"
#include "OS.h"
#include "Context.h"
std::map<int, ConnectionManager*> ConnectionManager::_all;
ConnectionManager::ConnectionManager()
: clientServer(1), popupMessages(1), mergeViews(1), _pid(0), _server(0)
{
// we need at least five for the solver menu
buttonName.resize(5);
buttonSwitch.resize(5);
optionName.resize(5);
optionValue.resize(5);
}
std::string ConnectionManager::getSocketName()
{
// FIXME: this should be changed to incorporate info about the
// connection number (i.e. the integer in the _all map) so that we
// can have several connections active at the same time
std::string sockname;
if(!strstr(CTX::instance()->solver.socketName.c_str(), ":")){
// Unix socket
std::ostringstream tmp;
tmp << CTX::instance()->homeDir << CTX::instance()->solver.socketName;
sockname = FixWindowsPath(tmp.str());
}
else{
// TCP/IP socket
sockname = CTX::instance()->solver.socketName;
// if only the port is given, prepend the host name
if(sockname.size() && sockname[0] == ':')
sockname = GetHostName() + sockname;
}
return sockname;
}
void ConnectionManager::runToGetOptions()
{
if(inputFileName.empty()) return;
std::string inputArg = inputFileName.empty() ? "" : ReplaceSubString
("%s", std::string("\"") + FixWindowsPath(inputFileName) + "\"", inputFileSwitch);
std::string optionArg = ReplaceSubString("%s", "", optionSwitch);
run(inputArg + " " + optionArg);
}
void ConnectionManager::runCommand(int commandIndex, int optionIndex, int optionChoice)
{
std::string inputArg = inputFileName.empty() ? "" : ReplaceSubString
("%s", std::string("\"") + FixWindowsPath(inputFileName) + "\"", inputFileSwitch);
std::string meshArg = meshFileName.empty() ? "" : ReplaceSubString
("%s", std::string("\"") + FixWindowsPath(meshFileName) + "\"", meshFileSwitch);
if(commandIndex < 0 || commandIndex >= (int)buttonSwitch.size()){
Msg::Error("Wrong command index");
return;
}
if(optionIndex < 0 || optionIndex >= (int)optionValue.size()){
Msg::Error("Wrong option index");
return;
}
std::string commandArg;
if(optionValue[optionIndex].size()){
if(optionChoice < 0 || optionChoice >= (int)optionValue[optionIndex].size()){
Msg::Error("Wrong option choice");
return;
}
commandArg = ReplaceSubString
("%s", optionValue[optionIndex][optionChoice], buttonSwitch[commandIndex]);
}
else{ // no options
commandArg = buttonSwitch[commandIndex];
}
run(inputArg + " " + meshArg + " " + commandArg + " " + extraArguments);
}
#if !defined(HAVE_FLTK)
void ConnectionManager::run(std::string args)
{
Msg::Error("Gmsh has to be compiled with FLTK support to run remote apps");
}
#endif
void ConnectionManager::kill()
{
if(_pid > 0) {
if(KillProcess(_pid))
Msg::Info("Killed '%s' (pid %d)", name.c_str(), _pid);
}
_pid = -1;
}
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _CONNECTION_MANAGER_H_
#define _CONNECTION_MANAGER_H_
#include <string>
#include <vector>
#include <map>
class GmshServer;
class ConnectionManager {
public:
// the name of the remote program (e.g. "GetDP")
std::string name;
// the executable command (e.g. "/usr/bin/getdp.exe")
std::string executable;
// any extra arguments to pass to the solver (e.g. "-ksp_monitor")
std::string extraArguments;
// the name of the input file for the remote program (e.g. "")
std::string inputFileName;
// the command line switch to specify the input file (e.g. "%s")
std::string inputFileSwitch;
// the standard extension of input file names for the remote program
// (e.g. ".pro")
std::string inputFileExtension;
// the name of the mesh file used by the remote program (e.g. "")
std::string meshFileName;
// the command line switch used to specify the mesh file
// (e.g. "-mesh %s")
std::string meshFileSwitch;
// the command line switch used to specify the socket (e.g. "-socket
// %s")
std::string socketSwitch;
// the names of the action buttons in the GUI (e.g. "Pre", "Cal",
// "Post")
std::vector<std::string> buttonName;
// the command line switches associated with the buttons (e.g. "-pre
// %s", "-cal", "-pos %s"); each %s will consume one of the options,
// in the order the buttons are defined
std::vector<std::string> buttonSwitch;
// the name of the options that can be passed to the remote program
// (e.g. "Resolution", "PostOperation")
std::vector<std::string> optionName;
// the command line switch to get the available values for all the
// options
std::string optionSwitch;
// the possible values for each option (these are normally
// dynamically filled by calling the remote program with the
// optionSwitch command line arg)
std::vector<std::vector<std::string> > optionValue;
// a help string describing the remote program
std::string help;
// set to true if the remote program should communicate with Gmsh
// through a socket
bool clientServer;
// set to true if remote messages should pop up the message window
bool popupMessages;
// set to true if remotely generated post-processing files should be
// merged by Gmsh
bool mergeViews;
private:
// the process id number of the remote program while it is running,
// or -1 when stopped
int _pid;
// a pointer to the server when the remote program is running, or 0
// when stopped
GmshServer *_server;
// a static map of all available remote programs: values 0, 1, 2, 3,
// 4 are reserved for the main solver menu; -1 is used when
// permanently listening for incoming connections; 99 is used for
// remote Gmsh
static std::map<int, ConnectionManager*> _all;
public:
ConnectionManager();
~ConnectionManager(){}
// get the name of the socket
std::string getSocketName();
// get/set the pid
int getPid(){ return _pid; }
void setPid(int pid){ _pid = pid; }
// get/set the server
GmshServer *getServer(){ return _server; }
void setServer(GmshServer *server){ _server = server; }
// get the num-th remote program; if it does not exist, create it
static ConnectionManager *get(int num)
{
std::map<int, ConnectionManager*>::iterator it = _all.find(num);
if(it == _all.end()){
ConnectionManager *s = new ConnectionManager();
_all[num] = s;
return s;
}
return it->second;
}
// run the remote program to get its options
void runToGetOptions();
// run the commandIndex-th command (button), using the specified
// option
void runCommand(int commandIndex, int optionIndex, int optionChoice);
// run the remote program with the given arguments
void run(std::string args);
// kill the remote program
void kill();
};
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <stdlib.h>
#include <string.h>
#include "GmshConfig.h"
#include "Context.h"
#include "OS.h"
#if defined(HAVE_FLTK)
#include <FL/Fl.H>
#endif
CTX::CTX()
{
// initialize everything that has no default value in
// DefaultOptions.h
short int word = 0x0001;
char *byte = (char*)&word;
bigEndian = (byte[0] ? 0 : 1);
const char *tmp;
if((tmp = GetEnvironmentVar("GMSH_HOME")))
homeDir = tmp;
else if((tmp = GetEnvironmentVar("HOME")))
homeDir = tmp;
else if((tmp = GetEnvironmentVar("TMP")))
homeDir = tmp;
else if((tmp = GetEnvironmentVar("TEMP")))
homeDir = tmp;
else
homeDir = "";
int len = homeDir.size();
if(len && homeDir[len - 1] != '/')
homeDir += "/";
batch = batchAfterMesh = 0;
outputFileName = "";
bgmFileName = "";
createAppendMeshStatReport = 0;
lc = 1.;
min[0] = min[1] = min[2] = max[2] = 0.;
max[0] = max[1] = 1.; // for nice view when adding point in new model
cg[0] = cg[1] = cg[2] = 0.;
polygonOffset = 0;
printing = 0;
meshTimer[0] = meshTimer[1] = meshTimer[2] = 0.;
drawRotationCenter = 0;
pickElements = 0;
geom.draw = 1;
mesh.draw = 1;
post.draw = 1;
post.combineTime = 0; // try to combineTime views at startup
lock = 0; // very primitive locking
#if defined(HAVE_FLTK)
glFontEnum = FL_HELVETICA;
#else
glFontEnum = -1;
#endif
forcedBBox = 0;
hideUnselected = 0;
numWindows = numTiles = 1;
deltaFontSize = 0;
recentFiles.resize(5);
mesh.optimizeLloyd = 0;
// need to initialize these too, since the corresponding opt_XXX
// routine uses the current value to set "mesh.changed"
mesh.changed = 0;
mesh.qualityInf = mesh.qualitySup = mesh.qualityType = 0;
mesh.radiusInf = mesh.radiusSup = 0;
mesh.lines = mesh.triangles = mesh.tetrahedra = mesh.quadrangles = 0;
mesh.prisms = mesh.pyramids = mesh.hexahedra = 0;
mesh.volumesEdges = mesh.volumesFaces = mesh.surfacesEdges = mesh.surfacesFaces = 0;
mesh.volumesFaces = mesh.surfacesEdges = mesh.surfacesFaces = 0;
mesh.smoothInternalEdges = mesh.smoothNormals = mesh.reverseAllNormals = 0;
mesh.explode = mesh.numSubEdges = mesh.angleSmoothNormals = 0;
mesh.colorCarousel = 0;
color.mesh.tangents = color.mesh.tetrahedron = color.mesh.triangle = 0;
color.mesh.prism = color.mesh.pyramid = color.mesh.hexahedron = 0;
color.mesh.tangents = color.mesh.line = color.mesh.quadrangle = 0;
for (int i = 0; i < 20; i++)
color.mesh.carousel[i] = 0;
}
CTX *CTX::_instance = 0;
CTX *CTX::instance()
{
if(!_instance) _instance = new CTX();
return _instance;
}
unsigned int CTX::packColor(int R, int G, int B, int A)
{
if(bigEndian)
return ( (unsigned int)((R)<<24 | (G)<<16 | (B)<<8 | (A)) );
else
return ( (unsigned int)((A)<<24 | (B)<<16 | (G)<<8 | (R)) );
}
int CTX::unpackRed(unsigned int X)
{
if(bigEndian)
return ( ( (X) >> 24 ) & 0xff );
else
return ( (X) & 0xff );
}
int CTX::unpackGreen(unsigned int X)
{
if(bigEndian)
return ( ( (X) >> 16 ) & 0xff );
else
return ( ( (X) >> 8 ) & 0xff );
}
int CTX::unpackBlue(unsigned int X)
{
if(bigEndian)
return ( ( (X) >> 8 ) & 0xff );
else
return ( ( (X) >> 16 ) & 0xff );
}
int CTX::unpackAlpha(unsigned int X)
{
if(bigEndian)
return ( (X) & 0xff );
else
return ( ( (X) >> 24 ) & 0xff );
}
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
#include <vector>
#include <string>
#include "CGNSOptions.h"
#include "meshPartitionOptions.h"
// The interface-independent context.
struct contextMeshOptions {
int draw, changed, light, lightTwoSide, lightLines, pointType;
int points, lines, triangles, quadrangles, tetrahedra, hexahedra, prisms, pyramids;
int surfacesEdges, surfacesFaces, volumesEdges, volumesFaces, numSubEdges;
int pointsNum, linesNum, surfacesNum, volumesNum, qualityType, labelType;
int optimize, optimizeNetgen, optimizeLloyd, refineSteps, remove4triangles;
double normals, tangents, explode, angleSmoothNormals, allowSwapEdgeAngle;
double mshFileVersion, mshFilePartitioned, pointSize, lineWidth;
double qualityInf, qualitySup, radiusInf, radiusSup;
double scalingFactor, lcFactor, randFactor, lcIntegrationPrecision;
double lcMin, lcMax, toleranceEdgeLength, anisoMax, smoothRatio;
int lcFromPoints, lcFromCurvature, lcExtendFromBoundary;
int dual, voronoi, drawSkinOnly, colorCarousel, labelSampling;
int fileFormat, nbSmoothing, algo2d, algo3d, algoSubdivide;
int algoRecombine, recombineAll;
int remeshParam, remeshAlgo;
int order, secondOrderLinear, secondOrderIncomplete;
int secondOrderExperimental, meshOnlyVisible;
int smoothInternalEdges, minCircPoints, minCurvPoints;
int saveAll, saveGroupsOfNodes, binary, bdfFieldFormat, saveParametric;
int smoothNormals, reverseAllNormals, zoneDefinition, clip;
int saveElementTagType;
int switchElementTags;
int highOrderNoMetric;
int multiplePasses;
};
struct contextGeometryOptions {
int draw, light, lightTwoSide, points, lines, surfaces, volumes;
int pointsNum, linesNum, surfacesNum, volumesNum;
double pointSize, lineWidth, selectedPointSize, selectedLineWidth;
int pointType, lineType, surfaceType, numSubEdges;
int oldCircle, extrudeSplinePoints, extrudeReturnLateral, oldNewreg;
double normals, tangents, scalingFactor;
int autoCoherence, highlightOrphans, clip, useTransform;
double tolerance, snap[3], transform[3][3], offset[3];
int occFixSmallEdges, occFixSmallFaces, occSewFaces, occConnectFaces;
int copyMeshingMethod, exactExtrusion;
int matchGeomAndMesh;
};
class CTX {
private:
static CTX *_instance;
public:
CTX();
~CTX(){}
static CTX *instance();
public:
// files on the command line and various file names
std::vector<std::string> files;
std::string bgmFileName, outputFileName, defaultFileName, tmpFileName;
std::string sessionFileName, optionsFileName, errorFileName;
std::string meshStatReportFileName;
// the home directory
std::string homeDir;
// file history
std::vector<std::string> recentFiles;
// create mesh statistics report (0: do nothing, 1: create, 2: append)
int createAppendMeshStatReport;
// save session/option file on exit?
int sessionSave, optionsSave;
// ask confirmation when overwriting files?
int confirmOverwrite;
// forced display host:0.0 under X11
std::string display;
// FLTK theme
std::string guiTheme;
// print messages on to the terminal?
int terminal;
// number of graphical windows/tiles
int numWindows, numTiles;
// text editor and web browser command (with included '%s')
std::string editor, webBrowser;
// pattern of files to watch out for
std::string watchFilePattern;
// show tootips in the GUI?
int tooltips;
// scroll automatically to last message in the message window?
int msgAutoScroll;
// position and size of various windows in the GUI
int menuPosition[2], glPosition[2], glSize[2], msgPosition[2], msgSize[2];
int optPosition[2], visPosition[2], clipPosition[2], manipPosition[2];
int statPosition[2], ctxPosition[2], solverPosition[2];
int pluginPosition[2], pluginSize[2], fieldPosition[2], fieldSize[2];
int fileChooserPosition[2];
// use the system menu bar on Mac OS X?
int systemMenuBar;
// batch mode (-4: lua session, -3: server daemon, -2: check coherence, -1: write
// geo, 0: full gfx, 1: 1D mesh, 2: 2D mesh, 3: 3D mesh, 4: adapt
// mesh, 5: refine mesh)
int batch;
// batch operations to apply after meshing (1: partition mesh)
int batchAfterMesh;
// initial menu (0: automatic, 1: geom, 2: mesh, 3: solver, 4: post)
int initialContext;
// never popup dialogs in scripts (use default values instead)?
int noPopup;
// make all windows "non modal"?
int nonModalWindows;
// clipping plane distance factor
double clipFactor;
// display border factor (0 = model fits window size exactly)
double displayBorderFactor;
// do or do not use the trackball for rotations
int useTrackball, trackballHyperbolicSheet;
// point around which to rotate the scene
double rotationCenter[3];
// rotate around the center of mass instead of rotationCenter[]
int rotationCenterCg;
// "overall" x, y and z min used for drawing and lc computation
double min[3], max[3];
// "center of mass" of the current geometry, used for graphics only
double cg[3];
// characteristic length for the whole problem (never used in mesh
// generation ->only for geo/post)
double lc;
// double buffer/antialias/stereo graphics?
int db, antialiasing, stereo, camera;
double eye_sep_ratio,focallength_ratio,camera_aperture;
// orthogonal projection?
int ortho;
// draw the bounding boxes and the rot center?
int drawBBox, drawRotationCenter;
// draw simplified model during user interaction?
int fastRedraw;
// small axes options
int smallAxes, smallAxesSize, smallAxesPos[2];
// large axes options
int axes, axesAutoPosition, axesTics[3], axesMikado;
double axesPosition[6];
std::string axesLabel[3], axesFormat[3];
// simple dynamic lock (should be a mutex)
int lock;
// enable alpha blending?
int alpha;
// mouse2 zoom coefficient
double zoomFactor;
// draw background gradient?
int bgGradient;
// draw background image?
std::string bgImageFileName;
double bgImagePosition[2];
// fltk font size (and delta for palette windows)
int fontSize, deltaFontSize;
// font name, FLTK enum and size for opengl graphics
std::string glFont, glFontTitle;
int glFontEnum, glFontEnumTitle, glFontSize, glFontSizeTitle;
// point/line widths
double pointSize, lineWidth;
// light options
int light[6];
double lightPosition[6][4], shine, shineExponent;
// clipping plane options
double clipPlane[6][4];
int clipWholeElements, clipOnlyDrawIntersectingVolume, clipOnlyVolume;
// polygon offset options
int polygonOffset, polygonOffsetAlways;
double polygonOffsetFactor, polygonOffsetUnits;
// color scheme
int colorScheme;
// number of subdivisions for gluQuadrics
int quadricSubdivisions;
// vector display type and options (for normals, etc.)
int vectorType;
double arrowRelHeadRadius, arrowRelStemRadius, arrowRelStemLength;
// records cpu times for 1-D, 2-D and 3-D mesh generation
double meshTimer[3];
// dynamic variable tracking if the bbox is currently imposed
int forcedBBox;
// enable selection/hover/picking using the mouse
int mouseSelection, mouseHoverMeshes, pickElements;
// disable some warnings for expert users?
int expertMode;
// dynamic: equal to 1 while gmsh is printing
int printing;
// hide all unselected entities?
int hideUnselected;
// temporary storage of rotation, translation, scale (until the GUI
// is ready)
double tmpRotation[3], tmpTranslation[3], tmpScale[3], tmpQuaternion[4];
// geometry options
contextGeometryOptions geom;
// mesh options
contextMeshOptions mesh;
// FIXME: putting these in the mesh struct (where they belong) causes
// an LNK1179 error ("duplicate COMDAT") with MSVC...
meshPartitionOptions partitionOptions;
CGNSOptions cgnsOptions;
// post processing options
struct{
int draw, link, horizontalScales;
int smooth, animCycle, combineTime, combineRemoveOrig;
int fileFormat, plugins;
double animDelay;
}post;
// solver options
struct{
int plugins, listen;
double timeout;
std::string socketName;
}solver;
// print options
struct{
int fileFormat, epsQuality, epsBackground, epsCompress, epsPS3Shading;
int epsOcclusionCulling, epsBestRoot;
double epsLineWidthFactor, epsPointSizeFactor;
int jpegQuality, jpegSmoothing, geoLabels, text, texAsEquation;
int gifDither, gifSort, gifInterlace, gifTransparent;
int posElementary, posElement, posGamma, posEta, posRho, posDisto;
int compositeWindows, deleteTmpFiles;
} print;
// color options
struct{
unsigned int bg, bgGrad, fg, text, axes, smallAxes;
unsigned int ambientLight[6], diffuseLight[6], specularLight[6];
struct{
unsigned int point, line, surface, volume;
unsigned int selection, highlight[3], projection;
unsigned int tangents, normals;
} geom;
struct{
unsigned int vertex, vertexSup, line, triangle, quadrangle;
unsigned int tetrahedron, hexahedron, prism, pyramid;
unsigned int carousel[20];
unsigned int tangents, normals;
} mesh;
} color;
// is the machine big-endian?
int bigEndian;
// how RGBA values are packed and unpacked into/from an unsigned
// integer to be fed to glColor4ubv (depends on machine byte
// ordering!):
unsigned int packColor(int R, int G, int B, int A);
int unpackRed(unsigned int X);
int unpackGreen(unsigned int X);
int unpackBlue(unsigned int X);
int unpackAlpha(unsigned int X);
};
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include "GmshConfig.h"
#include "GmshMessage.h"
#include "GModel.h"
#include "GmshDefines.h"
#include "StringUtils.h"
#include "Context.h"
#include "Options.h"
#include "OS.h"
#if defined(HAVE_OPENGL)
#include "drawContext.h"
#endif
#if defined(HAVE_FLTK)
#include "FlGui.h"
#include "graphicWindow.h"
#include "gl2ps.h"
#include "gl2gif.h"
#include "gl2jpeg.h"
#include "gl2png.h"
#include "gl2ppm.h"
#include "gl2yuv.h"
#endif
int GuessFileFormatFromFileName(std::string fileName)
{
std::string ext = SplitFileName(fileName)[2];
if (ext == ".geo") return FORMAT_GEO;
else if(ext == ".msh") return FORMAT_MSH;
else if(ext == ".pos") return FORMAT_POS;
else if(ext == ".opt") return FORMAT_OPT;
else if(ext == ".unv") return FORMAT_UNV;
else if(ext == ".vtk") return FORMAT_VTK;
else if(ext == ".txt") return FORMAT_TXT;
else if(ext == ".stl") return FORMAT_STL;
else if(ext == ".cgns") return FORMAT_CGNS;
else if(ext == ".med") return FORMAT_MED;
else if(ext == ".rmed") return FORMAT_RMED;
else if(ext == ".ir3") return FORMAT_IR3;
else if(ext == ".mesh") return FORMAT_MESH;
else if(ext == ".mail") return FORMAT_MAIL;
else if(ext == ".bdf") return FORMAT_BDF;
else if(ext == ".diff") return FORMAT_DIFF;
else if(ext == ".inp") return FORMAT_INP;
else if(ext == ".nas") return FORMAT_BDF;
else if(ext == ".p3d") return FORMAT_P3D;
else if(ext == ".wrl") return FORMAT_VRML;
else if(ext == ".vrml") return FORMAT_VRML;
else if(ext == ".ply2") return FORMAT_PLY2;
else if(ext == ".gif") return FORMAT_GIF;
else if(ext == ".jpg") return FORMAT_JPEG;
else if(ext == ".jpeg") return FORMAT_JPEG;
else if(ext == ".mpg") return FORMAT_MPEG;
else if(ext == ".mpeg") return FORMAT_MPEG;
else if(ext == ".png") return FORMAT_PNG;
else if(ext == ".ps") return FORMAT_PS;
else if(ext == ".eps") return FORMAT_EPS;
else if(ext == ".pdf") return FORMAT_PDF;
else if(ext == ".tex") return FORMAT_TEX;
else if(ext == ".svg") return FORMAT_SVG;
else if(ext == ".ppm") return FORMAT_PPM;
else if(ext == ".yuv") return FORMAT_YUV;
else if(ext == ".brep") return FORMAT_BREP;
else if(ext == ".step") return FORMAT_STEP;
else if(ext == ".stp") return FORMAT_STEP;
else if(ext == ".iges") return FORMAT_IGES;
else if(ext == ".igs") return FORMAT_IGES;
else return -1;
}
std::string GetDefaultFileName(int format)
{
std::vector<std::string> split = SplitFileName(GModel::current()->getFileName());
std::string name = split[0] + split[1];
switch(format){
case FORMAT_GEO: name += ".geo_unrolled"; break;
case FORMAT_MSH: name += ".msh"; break;
case FORMAT_POS: name += ".pos"; break;
case FORMAT_OPT: name += ".opt"; break;
case FORMAT_UNV: name += ".unv"; break;
case FORMAT_VTK: name += ".vtk"; break;
case FORMAT_STL: name += ".stl"; break;
case FORMAT_CGNS: name += ".cgns"; break;
case FORMAT_MED: name += ".med"; break;
case FORMAT_RMED: name += ".rmed"; break;
case FORMAT_IR3: name += ".ir3"; break;
case FORMAT_MESH: name += ".mesh"; break;
case FORMAT_MAIL: name += ".mail"; break;
case FORMAT_BDF: name += ".bdf"; break;
case FORMAT_DIFF: name += ".diff"; break;
case FORMAT_INP: name += ".inp"; break;
case FORMAT_P3D: name += ".p3d"; break;
case FORMAT_VRML: name += ".wrl"; break;
case FORMAT_PLY2: name += ".ply2"; break;
case FORMAT_GIF: name += ".gif"; break;
case FORMAT_JPEG: name += ".jpg"; break;
case FORMAT_MPEG: name += ".mpg"; break;
case FORMAT_PNG: name += ".png"; break;
case FORMAT_PS: name += ".ps"; break;
case FORMAT_EPS: name += ".eps"; break;
case FORMAT_PDF: name += ".pdf"; break;
case FORMAT_TEX: name += ".tex"; break;
case FORMAT_SVG: name += ".svg"; break;
case FORMAT_PPM: name += ".ppm"; break;
case FORMAT_YUV: name += ".yuv"; break;
case FORMAT_BREP: name += ".brep"; break;
case FORMAT_IGES: name += ".iges"; break;
case FORMAT_STEP: name += ".step"; break;
default: break;
}
return name;
}
#if defined(HAVE_FLTK)
static PixelBuffer *GetCompositePixelBuffer(GLenum format, GLenum type)
{
PixelBuffer *buffer;
if(!CTX::instance()->print.compositeWindows){
GLint width = FlGui::instance()->getCurrentOpenglWindow()->w();
GLint height = FlGui::instance()->getCurrentOpenglWindow()->h();
buffer = new PixelBuffer(width, height, format, type);
buffer->fill(CTX::instance()->batch);
}
else{
graphicWindow *g = FlGui::instance()->graph[0];
for(unsigned int i = 1; i < FlGui::instance()->graph.size(); i++){
for(unsigned int j = 0; j < FlGui::instance()->graph[i]->gl.size(); j++){
if(FlGui::instance()->graph[i]->gl[j] ==
FlGui::instance()->getCurrentOpenglWindow()){
g = FlGui::instance()->graph[i];
break;
}
}
}
int ww = 0, hh = 0;
std::vector<PixelBuffer*> buffers;
for(unsigned int i = 0; i < g->gl.size(); i++){
openglWindow::setLastHandled(g->gl[i]);
buffer = new PixelBuffer(g->gl[i]->w(), g->gl[i]->h(), format, type);
buffer->fill(CTX::instance()->batch);
buffers.push_back(buffer);
ww = std::max(ww, g->gl[i]->x() + g->gl[i]->w());
hh = std::max(hh, g->gl[i]->y() + g->gl[i]->h());
}
buffer = new PixelBuffer(ww, hh, format, type);
for(unsigned int i = 0; i < g->gl.size(); i++){
buffer->copyPixels(g->gl[i]->x(), hh - g->gl[i]->h() - g->gl[i]->y(),
buffers[i]);
delete buffers[i];
}
}
return buffer;
}
#endif
void CreateOutputFile(std::string fileName, int format)
{
if(fileName.empty())
fileName = GetDefaultFileName(format);
int oldFormat = CTX::instance()->print.fileFormat;
CTX::instance()->print.fileFormat = format;
CTX::instance()->printing = 1;
if(format != FORMAT_AUTO)
Msg::StatusBar(2, true, "Writing '%s'...", fileName.c_str());
bool printEndMessage = true;
switch (format) {
case FORMAT_AUTO:
CreateOutputFile(fileName, GuessFileFormatFromFileName(fileName));
printEndMessage = false;
break;
case FORMAT_OPT:
PrintOptions(0, GMSH_FULLRC, 1, 1, fileName.c_str());
break;
case FORMAT_MSH:
if(GModel::current()->getMeshPartitions().size() &&
CTX::instance()->mesh.mshFilePartitioned){
GModel::current()->writePartitionedMSH
(fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.saveParametric, CTX::instance()->mesh.scalingFactor);
}
else{
GModel::current()->writeMSH
(fileName, CTX::instance()->mesh.mshFileVersion,
CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.saveParametric, CTX::instance()->mesh.scalingFactor);
}
break;
case FORMAT_STL:
GModel::current()->writeSTL
(fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_VRML:
GModel::current()->writeVRML
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_PLY2:
GModel::current()->writePLY2(fileName);
break;
case FORMAT_UNV:
GModel::current()->writeUNV
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.saveGroupsOfNodes,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_VTK:
GModel::current()->writeVTK
(fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.scalingFactor,
CTX::instance()->bigEndian);
break;
case FORMAT_MESH:
GModel::current()->writeMESH
(fileName, CTX::instance()->mesh.saveElementTagType,
CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_MAIL:
GModel::current()->writeMAIL
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_IR3:
GModel::current()->writeIR3
(fileName, CTX::instance()->mesh.saveElementTagType,
CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_BDF:
GModel::current()->writeBDF
(fileName, CTX::instance()->mesh.bdfFieldFormat,
CTX::instance()->mesh.saveElementTagType, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_DIFF:
GModel::current()->writeDIFF
(fileName, CTX::instance()->mesh.binary, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_INP:
GModel::current()->writeINP
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_P3D:
GModel::current()->writeP3D
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_CGNS:
GModel::current()->writeCGNS
(fileName, CTX::instance()->mesh.zoneDefinition, CTX::instance()->cgnsOptions,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_MED:
GModel::current()->writeMED
(fileName, CTX::instance()->mesh.saveAll, CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_POS:
GModel::current()->writePOS
(fileName, CTX::instance()->print.posElementary,
CTX::instance()->print.posElement, CTX::instance()->print.posGamma,
CTX::instance()->print.posEta, CTX::instance()->print.posRho,
CTX::instance()->print.posDisto, CTX::instance()->mesh.saveAll,
CTX::instance()->mesh.scalingFactor);
break;
case FORMAT_GEO:
GModel::current()->writeGEO(fileName, CTX::instance()->print.geoLabels);
break;
case FORMAT_BREP:
GModel::current()->writeOCCBREP(fileName);
break;
case FORMAT_STEP:
GModel::current()->writeOCCSTEP(fileName);
break;
#if defined(HAVE_FLTK)
case FORMAT_PPM:
case FORMAT_YUV:
case FORMAT_GIF:
case FORMAT_JPEG:
case FORMAT_PNG:
{
if(!FlGui::available()) break;
FILE *fp = fopen(fileName.c_str(), "wb");
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
break;
}
int oldGradient = CTX::instance()->bgGradient;
if(format == FORMAT_GIF && CTX::instance()->print.gifTransparent)
CTX::instance()->bgGradient = 0;
PixelBuffer *buffer = GetCompositePixelBuffer(GL_RGB, GL_UNSIGNED_BYTE);
CTX::instance()->bgGradient = oldGradient;
if(format == FORMAT_PPM)
create_ppm(fp, buffer);
else if(format == FORMAT_YUV)
create_yuv(fp, buffer);
else if(format == FORMAT_GIF)
create_gif(fp, buffer,
CTX::instance()->print.gifDither,
CTX::instance()->print.gifSort,
CTX::instance()->print.gifInterlace,
CTX::instance()->print.gifTransparent,
CTX::instance()->unpackRed(CTX::instance()->color.bg),
CTX::instance()->unpackGreen(CTX::instance()->color.bg),
CTX::instance()->unpackBlue(CTX::instance()->color.bg));
else if(format == FORMAT_JPEG)
create_jpeg(fp, buffer, CTX::instance()->print.jpegQuality,
CTX::instance()->print.jpegSmoothing);
else
create_png(fp, buffer, 100);
delete buffer;
fclose(fp);
}
break;
case FORMAT_PS:
case FORMAT_EPS:
case FORMAT_PDF:
case FORMAT_SVG:
{
if(!FlGui::available()) break;
FILE *fp = fopen(fileName.c_str(), "wb");
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
break;
}
std::string base = SplitFileName(fileName)[1];
GLint width = FlGui::instance()->getCurrentOpenglWindow()->w();
GLint height = FlGui::instance()->getCurrentOpenglWindow()->h();
GLint viewport[4] = {0, 0, width, height};
int oldGradient = CTX::instance()->bgGradient;
if(!CTX::instance()->print.epsBackground) CTX::instance()->bgGradient = 0;
PixelBuffer buffer(width, height, GL_RGB, GL_FLOAT);
if(CTX::instance()->print.epsQuality == 0)
buffer.fill(CTX::instance()->batch);
int psformat =
(format == FORMAT_PDF) ? GL2PS_PDF :
(format == FORMAT_PS) ? GL2PS_PS :
(format == FORMAT_SVG) ? GL2PS_SVG :
GL2PS_EPS;
int pssort =
(CTX::instance()->print.epsQuality == 3) ? GL2PS_NO_SORT :
(CTX::instance()->print.epsQuality == 2) ? GL2PS_BSP_SORT :
GL2PS_SIMPLE_SORT;
int psoptions =
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_SILENT |
(CTX::instance()->print.epsOcclusionCulling ? GL2PS_OCCLUSION_CULL : 0) |
(CTX::instance()->print.epsBestRoot ? GL2PS_BEST_ROOT : 0) |
(CTX::instance()->print.epsBackground ? GL2PS_DRAW_BACKGROUND : 0) |
(CTX::instance()->print.epsCompress ? GL2PS_COMPRESS : 0) |
(CTX::instance()->print.epsPS3Shading ? 0 : GL2PS_NO_PS3_SHADING);
GLint buffsize = 0;
int res = GL2PS_OVERFLOW;
while(res == GL2PS_OVERFLOW) {
buffsize += 2048 * 2048;
gl2psBeginPage(base.c_str(), "Gmsh", viewport,
psformat, pssort, psoptions, GL_RGBA, 0, NULL,
15, 20, 10, buffsize, fp, base.c_str());
if(CTX::instance()->print.epsQuality == 0){
double modelview[16], projection[16];
glGetDoublev(GL_PROJECTION_MATRIX, projection);
glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho((double)viewport[0], (double)viewport[2],
(double)viewport[1], (double)viewport[3], -1., 1.);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPos2d(0, 0);
gl2psDrawPixels(width, height, 0, 0, GL_RGB, GL_FLOAT, buffer.getPixels());
glMatrixMode(GL_PROJECTION);
glLoadMatrixd(projection);
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview);
}
else{
buffer.fill(CTX::instance()->batch);
}
res = gl2psEndPage();
}
CTX::instance()->bgGradient = oldGradient;
fclose(fp);
}
break;
case FORMAT_TEX:
{
if(!FlGui::available()) break;
FILE *fp = fopen(fileName.c_str(), "w");
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
break;
}
std::string base = SplitFileName(fileName)[1];
GLint width = FlGui::instance()->getCurrentOpenglWindow()->w();
GLint height = FlGui::instance()->getCurrentOpenglWindow()->h();
GLint viewport[4] = {0, 0, width, height};
GLint buffsize = 0;
int res = GL2PS_OVERFLOW;
while(res == GL2PS_OVERFLOW) {
buffsize += 2048 * 2048;
gl2psBeginPage(base.c_str(), "Gmsh", viewport,
GL2PS_TEX, GL2PS_NO_SORT, GL2PS_NONE, GL_RGBA, 0, NULL,
0, 0, 0, buffsize, fp, base.c_str());
PixelBuffer buffer(width, height, GL_RGB, GL_UNSIGNED_BYTE);
int oldtext = CTX::instance()->print.text;
CTX::instance()->print.text = 1;
buffer.fill(CTX::instance()->batch);
CTX::instance()->print.text = oldtext;
res = gl2psEndPage();
}
fclose(fp);
}
break;
#if defined(HAVE_MPEG_ENCODE)
case FORMAT_MPEG:
{
std::string parFileName = CTX::instance()->homeDir + ".gmsh-mpeg_encode.par";
FILE *fp = fopen(parFileName.c_str(), "w");
if(!fp){
Msg::Error("Unable to open file '%s'", parFileName.c_str());
break;
}
int numViews = (int)opt_post_nb_views(0, GMSH_GET, 0), numSteps = 0;
for(int i = 0; i < numViews; i++){
if(opt_view_visible(i, GMSH_GET, 0))
numSteps = std::max(numSteps,
(int)opt_view_nb_non_empty_timestep(i, GMSH_GET, 0));
}
std::vector<std::string> frames;
for(int i = 0; i < (CTX::instance()->post.animCycle ? numViews : numSteps); i++){
char tmp[256];
sprintf(tmp, ".gmsh-%03d.ppm", i);
frames.push_back(tmp);
}
status_play_manual(!CTX::instance()->post.animCycle, 0);
for(unsigned int i = 0; i < frames.size(); i++){
CreateOutputFile(CTX::instance()->homeDir + frames[i], FORMAT_PPM);
status_play_manual(!CTX::instance()->post.animCycle, 1);
}
int repeat = (int)(CTX::instance()->post.animDelay * 24);
if(repeat < 1) repeat = 1;
std::string pattern("I");
// including P frames would lead to smaller files, but the
// quality degradation is perceptible:
// for(int i = 1; i < repeat; i++) pattern += "P";
fprintf(fp, "PATTERN %s\nBASE_FILE_FORMAT PPM\nGOP_SIZE %d\n"
"SLICES_PER_FRAME 1\nPIXEL FULL\nRANGE 10\n"
"PSEARCH_ALG EXHAUSTIVE\nBSEARCH_ALG CROSS2\n"
"IQSCALE 1\nPQSCALE 1\nBQSCALE 25\nREFERENCE_FRAME DECODED\n"
"OUTPUT %s\nINPUT_CONVERT *\nINPUT_DIR %s\nINPUT\n",
pattern.c_str(), repeat, fileName.c_str(),
CTX::instance()->homeDir.c_str());
for(unsigned int i = 0; i < frames.size(); i++){
fprintf(fp, "%s", frames[i].c_str());
if(repeat > 1) fprintf(fp, " [1-%d]", repeat);
fprintf(fp, "\n");
}
fprintf(fp, "END_INPUT\n");
fclose(fp);
extern int mpeg_encode_main(int, char**);
char *args[] = {(char*)"gmsh", (char*)parFileName.c_str()};
try{
mpeg_encode_main(2, args);
}
catch (const char *error){
Msg::Error("mpeg_encode: %s", error);
}
if(opt_print_delete_tmp_files(0, GMSH_GET, 0)){
UnlinkFile(parFileName);
for(unsigned int i = 0; i < frames.size(); i++)
UnlinkFile(CTX::instance()->homeDir + frames[i]);
}
}
break;
#endif
#endif
default:
Msg::Error("Unknown output file format %d", format);
printEndMessage = false;
break;
}
if(printEndMessage) Msg::StatusBar(2, true, "Done writing '%s'", fileName.c_str());
CTX::instance()->print.fileFormat = oldFormat;
CTX::instance()->printing = 0;
#if defined(HAVE_OPENGL)
drawContext::global()->draw();
#endif
}
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _CREATE_FILE_H_
#define _CREATE_FILE_H_
#include <string>
int GuessFileFormatFromFileName(std::string fileName);
std::string GetDefaultFileName(int format);
void CreateOutputFile(std::string fileName, int format);
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _DEFAULT_OPTIONS_H_
#define _DEFAULT_OPTIONS_H_
#include "GmshConfig.h"
#include "GmshDefines.h"
#include "Options.h"
// PLEASE RESPECT THE ALPHABETICAL ORDER WHEN
// INSERTING A NEW OPTION!
//
// Option Database (General, Geometry, Mesh, Post, View, Print), with
// default values. The first number defines the level of saving: O
// for the option file, S for the session file and F for the full
// listing:
#define S GMSH_SESSIONRC
#define O GMSH_OPTIONSRC
#define F GMSH_FULLRC
// STRINGS
StringXString GeneralOptions_String[] = {
{ F|O, "AxesFormatX" , opt_general_axes_format0 , "%.3g" ,
"Number format for X-axis (in standard C form)" },
{ F|O, "AxesFormatY" , opt_general_axes_format1 , "%.3g" ,
"Number format for Y-axis (in standard C form)" },
{ F|O, "AxesFormatZ" , opt_general_axes_format2 , "%.3g" ,
"Number format for Z-axis (in standard C form)" },
{ F|O, "AxesLabelX" , opt_general_axes_label0 , "" ,
"X-axis label" },
{ F|O, "AxesLabelY" , opt_general_axes_label1 , "" ,
"Y-axis label" },
{ F|O, "AxesLabelZ" , opt_general_axes_label2 , "" ,
"Z-axis label" },
{ F|O, "BackgroundImageFileName" , opt_general_background_image_filename , "" ,
"Background image file in JPEG or PNG format" },
{ F|O, "DefaultFileName" , opt_general_default_filename , "untitled.geo" ,
"Default project file name" },
{ F, "Display" , opt_general_display , "" ,
"X server to use (only for Unix versions)" },
{ F|O, "ErrorFileName" , opt_general_error_filename , ".gmsh-errors" ,
"File into which the log is saved if a fatal error occurs" },
{ F, "FileName" , opt_general_filename , "" ,
"Current project file name (read-only)" },
{ F|O, "FltkTheme" , opt_general_gui_theme , "" ,
"FLTK user interface theme (try e.g. plastic or gtk+)" },
{ F|O, "GraphicsFont" , opt_general_graphics_font , "Helvetica" ,
"Font used in the graphic window" },
{ F|O, "GraphicsFontTitle" , opt_general_graphics_font_title , "Helvetica" ,
"Font used in the graphic window for titles" },
{ F|S, "OptionsFileName" , opt_general_options_filename , ".gmsh-options" ,
"Option file created with `Tools->Options->Save'; automatically read on startup" },
{ F|S, "RecentFile1", opt_general_recent_file1 , "untitled.geo" ,
"Most recent opened file"},
{ F|S, "RecentFile2", opt_general_recent_file2 , "untitled.geo" ,
"2nd most recent opened file"},
{ F|S, "RecentFile3", opt_general_recent_file3 , "untitled.geo" ,
"3rd most recent opened file"},
{ F|S, "RecentFile4", opt_general_recent_file4 , "untitled.geo" ,
"4th most recent opened file"},
{ F|S, "RecentFile5", opt_general_recent_file5 , "untitled.geo" ,
"5th most recent opened file"},
{ 0, "SessionFileName" , opt_general_session_filename , ".gmshrc" ,
"Option file into which session specific information is saved; automatically "
"read on startup" },
{ F|O, "TextEditor" , opt_general_editor ,
#if defined(WIN32)
"notepad.exe %s" ,
#elif defined(__APPLE__)
"open -t %s" ,
#else
"sensible-editor '%s' &" ,
#endif
"System command to launch a text editor" },
{ F|S, "TmpFileName" , opt_general_tmp_filename , ".gmsh-tmp" ,
"Temporary file used by the geometry module" },
{ F|O, "WebBrowser" , opt_general_web_browser ,
#if defined(WIN32)
"explorer.exe %s" ,
#elif defined(__APPLE__)
"open %s" ,
#else
"sensible-browser %s &" ,
#endif
"System command to launch a web browser" },
{ F, "WatchFilePattern", opt_general_watch_file_pattern , "" ,
"Pattern of files to merge as they become available"},
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString GeometryOptions_String[] = {
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString MeshOptions_String[] = {
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString SolverOptions_String[] = {
{ F|O, "SocketName" , opt_solver_socket_name ,
#if defined(WIN32) && !defined(__CYGWIN__)
"127.0.0.1:44122" , // use TCP/IP sockets by default on Windows
#else
".gmshsock" , // otherwise use Unix sockets by default
#endif
"Name of socket (TCP/IP if it contains the `:' character, UNIX otherwise)" },
{ F|O, "Name0" , opt_solver_name0 , "GetDP" ,
"Name of solver 0" },
{ F|O, "Help0" , opt_solver_help0 ,
"A General environment for the treatment of Discrete Problems\n\n"
"Copyright (C) 1997-2011 Patrick Dular and Christophe Geuzaine\n\n"
"Visit http://www.geuz.org/getdp/ for more info",
"Help string for solver 0" },
{ F|O, "Executable0" , opt_solver_executable0 ,
#if defined(WIN32)
"getdp.exe" ,
#else
"getdp" ,
#endif
"System command to launch solver 0 (should not contain the `&' character)" },
{ F|O, "ExtraArguments0" , opt_solver_extra_arguments0 , "" ,
"Extra arguments to pass to solver 0" },
{ F, "InputName0" , opt_solver_input_name0 , "" ,
"Default input file name for solver 0" },
{ F|O, "Extension0" , opt_solver_extension0 , ".pro" ,
"Default file name extension for solver 0" },
{ F, "MeshName0" , opt_solver_mesh_name0 , "" ,
"Default mesh file name for solver 0" },
{ F|O, "MeshCommand0" , opt_solver_mesh_command0 , "-msh %s" ,
"Command used to specify the mesh file for solver 0" },
{ F|O, "SocketCommand0", opt_solver_socket_command0, "-socket %s",
"Command to specify the socket to solver 0" },
{ F|O, "NameCommand0", opt_solver_name_command0, "%s",
"Command to specify the problem name to solver 0" },
{ F|O, "OptionCommand0" , opt_solver_option_command0 , "" ,
"Command to get options from solver 0" },
{ F|O, "FirstOption0" , opt_solver_first_option0 , "Resolution" ,
"Label of first option for solver 0" },
{ F|O, "SecondOption0" , opt_solver_second_option0 , "PostOperation" ,
"Label of second option for solver 0" },
{ F|O, "ThirdOption0" , opt_solver_third_option0 , "" ,
"Label of third option for solver 0" },
{ F|O, "FourthOption0" , opt_solver_fourth_option0 , "" ,
"Label of fourth option for solver 0" },
{ F|O, "FifthOption0" , opt_solver_fifth_option0 , "" ,
"Label of fifth option for solver 0" },
{ F|O, "FirstButton0" , opt_solver_first_button0 , "Pre" ,
"Label of first button for solver 0" },
{ F|O, "FirstButtonCommand0" , opt_solver_first_button_command0 , "-pre %s" ,
"Command associated with the first button for solver 0" },
{ F|O, "SecondButton0" , opt_solver_second_button0 , "Cal" ,
"Label of second button for solver 0" },
{ F|O, "SecondButtonCommand0" , opt_solver_second_button_command0 , "-cal" ,
"Command associated with the second button for solver 0" },
{ F|O, "ThirdButton0" , opt_solver_third_button0 , "Pos" ,
"Label of third button for solver 0" },
{ F|O, "ThirdButtonCommand0" , opt_solver_third_button_command0 , "-pos %s" ,
"Command associated with the third button for solver 0" },
{ F|O, "FourthButton0" , opt_solver_fourth_button0 , "" ,
"Label of fourth button for solver 0" },
{ F|O, "FourthButtonCommand0" , opt_solver_fourth_button_command0 , "" ,
"Command associated with the fourth button for solver 0" },
{ F|O, "FifthButton0" , opt_solver_fifth_button0 , "" ,
"Label of fifth button for solver 0" },
{ F|O, "FifthButtonCommand0" , opt_solver_fifth_button_command0 , "" ,
"Command associated with the fifth button for solver 0" },
{ F|O, "Name1" , opt_solver_name1 , "" ,
"Name of solver 1" },
{ F|O, "Help1" , opt_solver_help1 , "" ,
"Help string for solver 1" },
{ F|O, "Executable1" , opt_solver_executable1 , "" ,
"System command to launch solver 1 (should not contain the `&' character)" },
{ F|O, "ExtraArguments1" , opt_solver_extra_arguments1 , "" ,
"Extra arguments to pass to solver 1" },
{ F, "InputName1" , opt_solver_input_name1 , "" ,
"Default input file name for solver 1" },
{ F|O, "Extension1" , opt_solver_extension1 , "" ,
"Default file name extension for solver 1" },
{ F, "MeshName1" , opt_solver_mesh_name1 , "" ,
"Default mesh file name for solver 1" },
{ F|O, "MeshCommand1" , opt_solver_mesh_command1 , "" ,
"Command used to specify the mesh file for solver 1" },
{ F|O, "SocketCommand1", opt_solver_socket_command1, "-socket %s",
"Command to specify the socket to solver 1" },
{ F|O, "NameCommand1", opt_solver_name_command1, "%s",
"Command to specify the problem name to solver 1" },
{ F|O, "OptionCommand1" , opt_solver_option_command1 , "" ,
"Command to get options from solver 1" },
{ F|O, "FirstOption1" , opt_solver_first_option1 , "" ,
"Label of first option for solver 1" },
{ F|O, "SecondOption1" , opt_solver_second_option1 , "" ,
"Label of second option for solver 1" },
{ F|O, "ThirdOption1" , opt_solver_third_option1 , "" ,
"Label of third option for solver 1" },
{ F|O, "FourthOption1" , opt_solver_fourth_option1 , "" ,
"Label of fourth option for solver 1" },
{ F|O, "FifthOption1" , opt_solver_fifth_option1 , "" ,
"Label of fifth option for solver 1" },
{ F|O, "FirstButton1" , opt_solver_first_button1 , "" ,
"Label of first button for solver 1" },
{ F|O, "FirstButtonCommand1" , opt_solver_first_button_command1 , "" ,
"Command associated with the first button for solver 1" },
{ F|O, "SecondButton1" , opt_solver_second_button1 , "" ,
"Label of second button for solver 1" },
{ F|O, "SecondButtonCommand1" , opt_solver_second_button_command1 , "" ,
"Command associated with the second button for solver 1" },
{ F|O, "ThirdButton1" , opt_solver_third_button1 , "" ,
"Label of third button for solver 1" },
{ F|O, "ThirdButtonCommand1" , opt_solver_third_button_command1 , "" ,
"Command associated with the third button for solver 1" },
{ F|O, "FourthButton1" , opt_solver_fourth_button1 , "" ,
"Label of fourth button for solver 1" },
{ F|O, "FourthButtonCommand1" , opt_solver_fourth_button_command1 , "" ,
"Command associated with the fourth button for solver 1" },
{ F|O, "FifthButton1" , opt_solver_fifth_button1 , "" ,
"Label of fifth button for solver 1" },
{ F|O, "FifthButtonCommand1" , opt_solver_fifth_button_command1 , "" ,
"Command associated with the fifth button for solver 1" },
{ F|O, "Name2" , opt_solver_name2 , "" ,
"Name of solver 2" },
{ F|O, "Help2" , opt_solver_help2 , "" ,
"Help string for solver 2" },
{ F|O, "Executable2" , opt_solver_executable2 , "" ,
"System command to launch solver 2 (should not contain the `&' character)" },
{ F|O, "ExtraArguments2" , opt_solver_extra_arguments2 , "" ,
"Extra arguments to pass to solver 2" },
{ F, "InputName2" , opt_solver_input_name2 , "" ,
"Default input file name for solver 2" },
{ F|O, "Extension2" , opt_solver_extension2 , "" ,
"Default file name extension for solver 2" },
{ F, "MeshName2" , opt_solver_mesh_name2 , "" ,
"Default mesh file name for solver 2" },
{ F|O, "MeshCommand2" , opt_solver_mesh_command2 , "" ,
"Command used to specify the mesh file for solver 2" },
{ F|O, "SocketCommand2", opt_solver_socket_command2, "-socket %s",
"Command to specify the socket to solver 2" },
{ F|O, "NameCommand2", opt_solver_name_command2, "%s",
"Command to specify the problem name to solver 2" },
{ F|O, "OptionCommand2" , opt_solver_option_command2 , "" ,
"Command to get options from solver 2" },
{ F|O, "FirstOption2" , opt_solver_first_option2 , "" ,
"Label of first option for solver 2" },
{ F|O, "SecondOption2" , opt_solver_second_option2 , "" ,
"Label of second option for solver 2" },
{ F|O, "ThirdOption2" , opt_solver_third_option2 , "" ,
"Label of third option for solver 2" },
{ F|O, "FourthOption2" , opt_solver_fourth_option2 , "" ,
"Label of fourth option for solver 2" },
{ F|O, "FifthOption2" , opt_solver_fifth_option2 , "" ,
"Label of fifth option for solver 2" },
{ F|O, "FirstButton2" , opt_solver_first_button2 , "" ,
"Label of first button for solver 2" },
{ F|O, "FirstButtonCommand2" , opt_solver_first_button_command2 , "" ,
"Command associated with the first button for solver 2" },
{ F|O, "SecondButton2" , opt_solver_second_button2 , "" ,
"Label of second button for solver 2" },
{ F|O, "SecondButtonCommand2" , opt_solver_second_button_command2 , "" ,
"Command associated with the second button for solver 2" },
{ F|O, "ThirdButton2" , opt_solver_third_button2 , "" ,
"Label of third button for solver 2" },
{ F|O, "ThirdButtonCommand2" , opt_solver_third_button_command2 , "" ,
"Command associated with the third button for solver 2" },
{ F|O, "FourthButton2" , opt_solver_fourth_button2 , "" ,
"Label of fourth button for solver 2" },
{ F|O, "FourthButtonCommand2" , opt_solver_fourth_button_command2 , "" ,
"Command associated with the fourth button for solver 2" },
{ F|O, "FifthButton2" , opt_solver_fifth_button2 , "" ,
"Label of fifth button for solver 2" },
{ F|O, "FifthButtonCommand2" , opt_solver_fifth_button_command2 , "" ,
"Command associated with the fifth button for solver 2" },
{ F|O, "Name3" , opt_solver_name3 , "" ,
"Name of solver 3" },
{ F|O, "Help3" , opt_solver_help3 , "" ,
"Help string for solver 3" },
{ F|O, "Executable3" , opt_solver_executable3 , "" ,
"System command to launch solver 3 (should not contain the `&' character)" },
{ F|O, "ExtraArguments3" , opt_solver_extra_arguments3 , "" ,
"Extra arguments to pass to solver 3" },
{ F, "InputName3" , opt_solver_input_name3 , "" ,
"Default input file name for solver 3" },
{ F|O, "Extension3" , opt_solver_extension3 , "" ,
"Default file name extension for solver 3" },
{ F, "MeshName3" , opt_solver_mesh_name3 , "" ,
"Default mesh file name for solver 3" },
{ F|O, "MeshCommand3" , opt_solver_mesh_command3 , "" ,
"Command used to specify the mesh file for solver 3" },
{ F|O, "SocketCommand3", opt_solver_socket_command3, "-socket %s",
"Command to specify the socket to solver 3" },
{ F|O, "NameCommand3", opt_solver_name_command3, "%s",
"Command to specify the problem name to solver 3" },
{ F|O, "OptionCommand3" , opt_solver_option_command3 , "" ,
"Command to get options from solver 3" },
{ F|O, "FirstOption3" , opt_solver_first_option3 , "" ,
"Label of first option for solver 3" },
{ F|O, "SecondOption3" , opt_solver_second_option3 , "" ,
"Label of second option for solver 3" },
{ F|O, "ThirdOption3" , opt_solver_third_option3 , "" ,
"Label of third option for solver 3" },
{ F|O, "FourthOption3" , opt_solver_fourth_option3 , "" ,
"Label of fourth option for solver 3" },
{ F|O, "FifthOption3" , opt_solver_fifth_option3 , "" ,
"Label of fifth option for solver 3" },
{ F|O, "FirstButton3" , opt_solver_first_button3 , "" ,
"Label of first button for solver 3" },
{ F|O, "FirstButtonCommand3" , opt_solver_first_button_command3 , "" ,
"Command associated with the first button for solver 3" },
{ F|O, "SecondButton3" , opt_solver_second_button3 , "" ,
"Label of second button for solver 3" },
{ F|O, "SecondButtonCommand3" , opt_solver_second_button_command3 , "" ,
"Command associated with the second button for solver 3" },
{ F|O, "ThirdButton3" , opt_solver_third_button3 , "" ,
"Label of third button for solver 3" },
{ F|O, "ThirdButtonCommand3" , opt_solver_third_button_command3 , "" ,
"Command associated with the third button for solver 3" },
{ F|O, "FourthButton3" , opt_solver_fourth_button3 , "" ,
"Label of fourth button for solver 3" },
{ F|O, "FourthButtonCommand3" , opt_solver_fourth_button_command3 , "" ,
"Command associated with the fourth button for solver 3" },
{ F|O, "FifthButton3" , opt_solver_fifth_button3 , "" ,
"Label of fifth button for solver 3" },
{ F|O, "FifthButtonCommand3" , opt_solver_fifth_button_command3 , "" ,
"Command associated with the fifth button for solver 3" },
{ F|O, "Name4" , opt_solver_name4 , "" ,
"Name of solver 4" },
{ F|O, "Help4" , opt_solver_help4 , "" ,
"Help string for solver 4" },
{ F|O, "Executable4" , opt_solver_executable4 , "" ,
"System command to launch solver 4 (should not contain the `&' character)" },
{ F|O, "ExtraArguments4" , opt_solver_extra_arguments4 , "" ,
"Extra arguments to pass to solver 4" },
{ F, "InputName4" , opt_solver_input_name4 , "" ,
"Default input file name for solver 4" },
{ F|O, "Extension4" , opt_solver_extension4 , "" ,
"Default file name extension for solver 4" },
{ F, "MeshName4" , opt_solver_mesh_name4 , "" ,
"Default mesh file name for solver 4" },
{ F|O, "MeshCommand4" , opt_solver_mesh_command4 , "" ,
"Command used to specify the mesh file for solver 4" },
{ F|O, "SocketCommand4", opt_solver_socket_command4, "-socket %s",
"Command to specify the socket to solver 4" },
{ F|O, "NameCommand4", opt_solver_name_command4, "%s",
"Command to specify the problem name to solver 4" },
{ F|O, "OptionCommand4" , opt_solver_option_command4 , "" ,
"Command to get options from solver 4" },
{ F|O, "FirstOption4" , opt_solver_first_option4 , "" ,
"Label of first option for solver 4" },
{ F|O, "SecondOption4" , opt_solver_second_option4 , "" ,
"Label of second option for solver 4" },
{ F|O, "ThirdOption4" , opt_solver_third_option4 , "" ,
"Label of third option for solver 4" },
{ F|O, "FourthOption4" , opt_solver_fourth_option4 , "" ,
"Label of fourth option for solver 4" },
{ F|O, "FifthOption4" , opt_solver_fifth_option4 , "" ,
"Label of fifth option for solver 4" },
{ F|O, "FirstButton4" , opt_solver_first_button4 , "" ,
"Label of first button for solver 4" },
{ F|O, "FirstButtonCommand4" , opt_solver_first_button_command4 , "" ,
"Command associated with the first button for solver 4" },
{ F|O, "SecondButton4" , opt_solver_second_button4 , "" ,
"Label of second button for solver 4" },
{ F|O, "SecondButtonCommand4" , opt_solver_second_button_command4 , "" ,
"Command associated with the second button for solver 4" },
{ F|O, "ThirdButton4" , opt_solver_third_button4 , "" ,
"Label of third button for solver 4" },
{ F|O, "ThirdButtonCommand4" , opt_solver_third_button_command4 , "" ,
"Command associated with the third button for solver 4" },
{ F|O, "FourthButton4" , opt_solver_fourth_button4 , "" ,
"Label of fourth button for solver 4" },
{ F|O, "FourthButtonCommand4" , opt_solver_fourth_button_command4 , "" ,
"Command associated with the fourth button for solver 4" },
{ F|O, "FifthButton4" , opt_solver_fifth_button4 , "" ,
"Label of fifth button for solver 4" },
{ F|O, "FifthButtonCommand4" , opt_solver_fifth_button_command4 , "" ,
"Command associated with the fifth button for solver 4" },
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString PostProcessingOptions_String[] = {
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString ViewOptions_String[] = {
{ F|O, "AxesFormatX" , opt_view_axes_format0 , "%.3g" ,
"Number format for X-axis (in standard C form)" },
{ F|O, "AxesFormatY" , opt_view_axes_format1 , "%.3g" ,
"Number format for Y-axis (in standard C form)" },
{ F|O, "AxesFormatZ" , opt_view_axes_format2 , "%.3g" ,
"Number format for Z-axis (in standard C form)" },
{ F|O, "AxesLabelX" , opt_view_axes_label0 , "" ,
"X-axis label" },
{ F|O, "AxesLabelY" , opt_view_axes_label1 , "" ,
"Y-axis label" },
{ F|O, "AxesLabelZ" , opt_view_axes_label2 , "" ,
"Z-axis label" },
{ F, "FileName" , opt_view_filename , "" ,
"Default post-processing view file name" },
{ F|O, "Format" , opt_view_format , "%.3g" ,
"Number format (in standard C form)" },
{ F|O, "GeneralizedRaiseX" , opt_view_gen_raise0 , "v0" ,
"Generalized elevation of the view along X-axis (in model coordinates)" },
{ F|O, "GeneralizedRaiseY" , opt_view_gen_raise1 , "v1" ,
"Generalized elevation of the view along Y-axis (in model coordinates)" },
{ F|O, "GeneralizedRaiseZ" , opt_view_gen_raise2 , "v2" ,
"Generalized elevation of the view along Z-axis (in model coordinates)" },
{ F, "Name" , opt_view_name , "" ,
"Default post-processing view name" },
{ F|O, "Stipple0" , opt_view_stipple0 , "1*0x1F1F" ,
"First stippling pattern" },
{ F|O, "Stipple1" , opt_view_stipple1 , "1*0x3333" ,
"Second stippling pattern" },
{ F|O, "Stipple2" , opt_view_stipple2 , "1*0x087F" ,
"Third stippling pattern" },
{ F|O, "Stipple3" , opt_view_stipple3 , "1*0xCCCF" ,
"Fourth stippling pattern" },
{ F|O, "Stipple4" , opt_view_stipple4 , "2*0x1111" ,
"Fifth stippling pattern" },
{ F|O, "Stipple5" , opt_view_stipple5 , "2*0x0F0F" ,
"Sixth stippling pattern" },
{ F|O, "Stipple6" , opt_view_stipple6 , "1*0xCFFF" ,
"Seventh stippling pattern" },
{ F|O, "Stipple7" , opt_view_stipple7 , "2*0x0202" ,
"Eighth stippling pattern" },
{ F|O, "Stipple8" , opt_view_stipple8 , "2*0x087F" ,
"Ninth stippling pattern" },
{ F|O, "Stipple9" , opt_view_stipple9 , "1*0xFFFF" ,
"Tenth stippling pattern" },
{ 0, 0 , 0 , "" , 0 }
} ;
StringXString PrintOptions_String[] = {
{ 0, 0 , 0 , "" , 0 }
} ;
// NUMBERS
StringXNumber GeneralOptions_Number[] = {
{ F|O, "AlphaBlending" , opt_general_alpha_blending , 1. ,
"Enable alpha blending (transparency) in post-processing views" },
{ F|O, "Antialiasing" , opt_general_antialiasing , 0. ,
"Use multisample antialiasing (will slow down rendering)" },
{ F|O, "ArrowHeadRadius" , opt_general_arrow_head_radius , 0.12 ,
"Relative radius of arrow head" },
{ F|O, "ArrowStemLength" , opt_general_arrow_stem_length , 0.56 ,
"Relative length of arrow stem" },
{ F|O, "ArrowStemRadius" , opt_general_arrow_stem_radius , 0.02 ,
"Relative radius of arrow stem" },
{ F|O, "Axes" , opt_general_axes , 0. ,
"Axes (0=none, 1=simple axes, 2=box, 3=full grid, 4=open grid, 5=ruler)" },
{ F|O, "AxesMikado" , opt_general_axes_mikado , 0. ,
"Mikado axes style" },
{ F|O, "AxesAutoPosition" , opt_general_axes_auto_position , 1. ,
"Position the axes automatically" },
{ F|O, "AxesMaxX" , opt_general_axes_xmax , 1. ,
"Maximum X-axis coordinate" },
{ F|O, "AxesMaxY" , opt_general_axes_ymax , 1. ,
"Maximum Y-axis coordinate" },
{ F|O, "AxesMaxZ" , opt_general_axes_zmax , 1. ,
"Maximum Z-axis coordinate" },
{ F|O, "AxesMinX" , opt_general_axes_xmin , 0. ,
"Minimum X-axis coordinate" },
{ F|O, "AxesMinY" , opt_general_axes_ymin , 0. ,
"Minimum Y-axis coordinate" },
{ F|O, "AxesMinZ" , opt_general_axes_zmin , 0. ,
"Minimum Z-axis coordinate" },
{ F|O, "AxesTicsX" , opt_general_axes_tics0 , 5. ,
"Number of tics on the X-axis" },
{ F|O, "AxesTicsY" , opt_general_axes_tics1 , 5. ,
"Number of tics on the Y-axis" },
{ F|O, "AxesTicsZ" , opt_general_axes_tics2 , 5. ,
"Number of tics on the Z-axis" },
{ F|O, "BackgroundGradient" , opt_general_background_gradient , 1. ,
"Draw background gradient (0=none, 1=vertical, 2=horizontal, 3=radial)" },
{ F|O, "BackgroundImagePositionX" , opt_general_background_image_position0 , 1.e5 ,
"X position (in pixels) of background image (< 0: measure from right edge; "
">= 1e5: centered)" },
{ F|O, "BackgroundImagePositionY" , opt_general_background_image_position1 , 1.e5 ,
"Y position (in pixels) of background image (< 0: measure from bottom edge; "
">= 1e5: centered)" },
{ F|O, "Camera" , opt_general_camera_mode, 0. ,
"Enable camera view mode" },
{ F|O, "CameraAperture" , opt_general_camera_aperture, 40. ,
"Camera aperture in degrees" },
{ F|O, "CameraEyeSeparationRatio" , opt_general_eye_sep_ratio, 1.5 ,
"Eye separation ratio in % for stereo rendering" },
{ F|O, "CameraFocalLengthRatio" , opt_general_focallength_ratio, 1.0 ,
"Camera Focal length ratio" },
{ F, "Clip0A" , opt_general_clip0a , 1.0 ,
"First coefficient in equation for clipping plane 0 (`A' in `AX+BY+CZ+D=0')" },
{ F, "Clip0B" , opt_general_clip0b , 0.0 ,
"Second coefficient in equation for clipping plane 0 (`B' in `AX+BY+CZ+D=0')" },
{ F, "Clip0C" , opt_general_clip0c , 0.0 ,
"Third coefficient in equation for clipping plane 0 (`C' in `AX+BY+CZ+D=0')" },
{ F, "Clip0D" , opt_general_clip0d , 0.0 ,
"Fourth coefficient in equation for clipping plane 0 (`D' in `AX+BY+CZ+D=0')" },
{ F, "Clip1A" , opt_general_clip1a , 0.0 ,
"First coefficient in equation for clipping plane 1" },
{ F, "Clip1B" , opt_general_clip1b , 1.0 ,
"Second coefficient in equation for clipping plane 1" },
{ F, "Clip1C" , opt_general_clip1c , 0.0 ,
"Third coefficient in equation for clipping plane 1" },
{ F, "Clip1D" , opt_general_clip1d , 0.0 ,
"Fourth coefficient in equation for clipping plane 1" },
{ F, "Clip2A" , opt_general_clip2a , 0.0 ,
"First coefficient in equation for clipping plane 2" },
{ F, "Clip2B" , opt_general_clip2b , 0.0 ,
"Second coefficient in equation for clipping plane 2" },
{ F, "Clip2C" , opt_general_clip2c , 1.0 ,
"Third coefficient in equation for clipping plane 2" },
{ F, "Clip2D" , opt_general_clip2d , 0.0 ,
"Fourth coefficient in equation for clipping plane 2" },
{ F, "Clip3A" , opt_general_clip3a , -1.0 ,
"First coefficient in equation for clipping plane 3" },
{ F, "Clip3B" , opt_general_clip3b , 0.0 ,
"Second coefficient in equation for clipping plane 3" },
{ F, "Clip3C" , opt_general_clip3c , 0.0 ,
"Third coefficient in equation for clipping plane 3" },
{ F, "Clip3D" , opt_general_clip3d , 1.0 ,
"Fourth coefficient in equation for clipping plane 3" },
{ F, "Clip4A" , opt_general_clip4a , 0.0 ,
"First coefficient in equation for clipping plane 4" },
{ F, "Clip4B" , opt_general_clip4b , -1.0 ,
"Second coefficient in equation for clipping plane 4" },
{ F, "Clip4C" , opt_general_clip4c , 0.0 ,
"Third coefficient in equation for clipping plane 4" },
{ F, "Clip4D" , opt_general_clip4d , 1.0 ,
"Fourth coefficient in equation for clipping plane 4" },
{ F, "Clip5A" , opt_general_clip5a , 0.0 ,
"First coefficient in equation for clipping plane 5" },
{ F, "Clip5B" , opt_general_clip5b , 0.0 ,
"Second coefficient in equation for clipping plane 5" },
{ F, "Clip5C" , opt_general_clip5c , -1.0 ,
"Third coefficient in equation for clipping plane 5" },
{ F, "Clip5D" , opt_general_clip5d , 1.0 ,
"Fourth coefficient in equation for clipping plane 5" },
{ F, "ClipFactor" , opt_general_clip_factor , 5.0 ,
"Near and far clipping plane distance factor (decrease value for better "
"z-buffer resolution)" },
{ F|O, "ClipOnlyDrawIntersectingVolume" ,
opt_general_clip_only_draw_intersecting_volume , 0. ,
"Only draw layer of elements that intersect the clipping plane" },
{ F|O, "ClipOnlyVolume" , opt_general_clip_only_volume , 0. ,
"Only clip volume elements" },
{ F|S, "ClipPositionX" , opt_general_clip_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the clipping "
"planes window" },
{ F|S, "ClipPositionY" , opt_general_clip_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the clipping "
"planes window" },
{ F|O, "ClipWholeElements" , opt_general_clip_whole_elements , 0. ,
"Clip whole elements" },
{ F|O, "ColorScheme", opt_general_color_scheme , 1. ,
"Default color scheme (0=dark, 1=light or 2=grayscale)" },
{ F|O, "ConfirmOverwrite" , opt_general_confirm_overwrite, 1. ,
"Ask confirmation before overwriting files?" },
{ F|S, "ContextPositionX" , opt_general_context_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the contextual "
"windows" },
{ F|S, "ContextPositionY" , opt_general_context_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the contextual "
"windows" },
{ F|O, "DisplayBorderFactor" , opt_general_display_border_factor , 1./3. ,
"Border factor for model display (0: model fits window size exactly)" },
{ F|O, "DoubleBuffer" , opt_general_double_buffer , 1. ,
"Use a double buffered graphic window (on Unix, should be set to 0 when "
"working on a remote host without GLX)" },
{ F|O, "DrawBoundingBoxes" , opt_general_draw_bounding_box, 0. ,
"Draw bounding boxes" },
{ F|O, "ExpertMode" , opt_general_expert_mode, 0. ,
"Enable expert mode (to disable all the messages meant for inexperienced "
"users)" },
{ F|O, "FastRedraw" , opt_general_fast_redraw, 0. ,
"Draw simplified model while rotating, panning and zooming" },
{ F|S, "FieldPositionX" , opt_general_field_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the field window" },
{ F|S, "FieldPositionY" , opt_general_field_position1 , 550. ,
"Vertical position (in pixels) of the upper left corner of the field window" },
{ F|S, "FieldHeight" , opt_general_field_size1 , 300. ,
"Height (in pixels) of the field window" },
{ F|S, "FieldWidth" , opt_general_field_size0 , 300. ,
"Width (in pixels) of the field window" },
{ F|S, "FileChooserPositionX" , opt_general_file_chooser_position0 , 200. ,
"Horizontal position (in pixels) of the upper left corner of the file chooser "
"windows" },
{ F|S, "FileChooserPositionY" , opt_general_file_chooser_position1 , 200. ,
"Vertical position (in pixels) of the upper left corner of the file chooser "
"windows" },
{ F|O, "FontSize" , opt_general_fontsize , -1. ,
"Size of the font in the user interface (-1=automatic)" },
{ F|O, "GraphicsFontSize" , opt_general_graphics_fontsize , 17. ,
"Size of the font in the graphic window" },
{ F|O, "GraphicsFontSizeTitle" , opt_general_graphics_fontsize_title , 19. ,
"Size of the font in the graphic window for titles" },
{ F|S, "GraphicsHeight" , opt_general_graphics_size1 , 600. ,
"Height (in pixels) of the graphic window" },
{ F|S, "GraphicsPositionX" , opt_general_graphics_position0 , 50. ,
"Horizontal position (in pixels) of the upper left corner of the graphic "
"window" },
{ F|S, "GraphicsPositionY" , opt_general_graphics_position1 , 50. ,
"Vertical position (in pixels) of the upper left corner of the graphic "
"window" },
{ F|S, "GraphicsWidth" , opt_general_graphics_size0 , 600. ,
"Width (in pixels) of the graphic window" },
{ F|O, "InitialModule", opt_general_initial_context, 0. ,
"Module launched on startup (0=automatic, 1=geometry, 2=mesh, 3=solver, "
"4=post-processing) " },
{ F|O, "Light0" , opt_general_light0 , 1. ,
"Enable light source 0" },
{ F|O, "Light0X" , opt_general_light00 , 0.65 ,
"X position of light source 0" },
{ F|O, "Light0Y" , opt_general_light01 , 0.65 ,
"Y position of light source 0" },
{ F|O, "Light0Z" , opt_general_light02 , 1.0 ,
"Z position of light source 0" },
{ F|O, "Light0W" , opt_general_light03 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 0 (W=0 means "
"infinitely far source)" },
{ F|O, "Light1" , opt_general_light1 , 0.,
"Enable light source 1" },
{ F|O, "Light1X" , opt_general_light10 , 0.5 ,
"X position of light source 1" },
{ F|O, "Light1Y" , opt_general_light11 , 0.3 ,
"Y position of light source 1" },
{ F|O, "Light1Z" , opt_general_light12 , 1.0 ,
"Z position of light source 1" },
{ F|O, "Light1W" , opt_general_light13 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 1 (W=0 means infinitely "
"far source)" },
{ F|O, "Light2" , opt_general_light2 , 0.,
"Enable light source 2" },
{ F|O, "Light2X" , opt_general_light20 , 0.5 ,
"X position of light source 2" },
{ F|O, "Light2Y" , opt_general_light21 , 0.3 ,
"Y position of light source 2" },
{ F|O, "Light2Z" , opt_general_light22 , 1.0 ,
"Z position of light source 2" },
{ F|O, "Light2W" , opt_general_light23 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 2 (W=0 means infinitely "
"far source)" },
{ F|O, "Light3" , opt_general_light3 , 0.,
"Enable light source 3" },
{ F|O, "Light3X" , opt_general_light30 , 0.5 ,
"X position of light source 3" },
{ F|O, "Light3Y" , opt_general_light31 , 0.3 ,
"Y position of light source 3" },
{ F|O, "Light3Z" , opt_general_light32 , 1.0 ,
"Z position of light source 3" },
{ F|O, "Light3W" , opt_general_light33 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 3 (W=0 means infinitely "
"far source)" },
{ F|O, "Light4" , opt_general_light4 , 0.,
"Enable light source 4" },
{ F|O, "Light4X" , opt_general_light40 , 0.5 ,
"X position of light source 4" },
{ F|O, "Light4Y" , opt_general_light41 , 0.3 ,
"Y position of light source 4" },
{ F|O, "Light4Z" , opt_general_light42 , 1.0 ,
"Z position of light source 4" },
{ F|O, "Light4W" , opt_general_light43 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 4 (W=0 means infinitely "
"far source)" },
{ F|O, "Light5" , opt_general_light5 , 0.,
"Enable light source 5" },
{ F|O, "Light5X" , opt_general_light50 , 0.5 ,
"X position of light source 5" },
{ F|O, "Light5Y" , opt_general_light51 , 0.3 ,
"Y position of light source 5" },
{ F|O, "Light5Z" , opt_general_light52 , 1.0 ,
"Z position of light source 5" },
{ F|O, "Light5W" , opt_general_light53 , 0.0 ,
"Divisor of the X, Y and Z coordinates of light source 5 (W=0 means infinitely "
"far source)" },
{ F|O, "LineWidth" , opt_general_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ F|S, "ManipulatorPositionX" , opt_general_manip_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the manipulator "
"window" },
{ F|S, "ManipulatorPositionY" , opt_general_manip_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the manipulator "
"window" },
{ F, "MaxX" , opt_general_xmax , 0. ,
"Maximum model coordinate along the X-axis (read-only)" },
{ F, "MaxY" , opt_general_ymax , 0. ,
"Maximum model coordinate along the Y-axis (read-only)" },
{ F, "MaxZ" , opt_general_zmax , 0. ,
"Maximum model coordinate along the Z-axis (read-only)" },
{ F|S, "MenuPositionX" , opt_general_menu_position0 , 800. ,
"Horizontal position (in pixels) of the upper left corner of the menu window" },
{ F|S, "MenuPositionY" , opt_general_menu_position1 , 50. ,
"Vertical position (in pixels) of the upper left corner of the menu window" },
{ F|O, "MessageAutoScroll" , opt_general_message_auto_scroll , 1. ,
"Automatically scroll message window" },
{ F|S, "MessagePositionX" , opt_general_message_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the message "
"window" },
{ F|S, "MessagePositionY" , opt_general_message_position1 , 490. ,
"Vertical position (in pixels) of the upper left corner of the message "
"window" },
{ F|S, "MessageHeight" , opt_general_message_size1 , 300. ,
"Height (in pixels) of the message window" },
{ F|S, "MessageWidth" , opt_general_message_size0 , 400. ,
"Width (in pixels) of the message window" },
{ F, "MinX" , opt_general_xmin , 0. ,
"Minimum model coordinate along the X-axis (read-only)" },
{ F, "MinY" , opt_general_ymin , 0. ,
"Minimum model coordinate along the Y-axis (read-only)" },
{ F, "MinZ" , opt_general_zmin , 0. ,
"Minimum model coordinate along the Z-axis (read-only)" },
{ F|O, "MouseHoverMeshes" , opt_general_mouse_hover_meshes , 0. ,
"Enable mouse hover on meshes" },
{ F|O, "MouseSelection" , opt_general_mouse_selection , 1. ,
"Enable mouse selection" },
{ F|S, "NonModalWindows" , opt_general_non_modal_windows , 1. ,
"Force all control windows to be on top of the graphic window "
"(\"non-modal\")" },
{ F|O, "NoPopup" , opt_general_nopopup , 0. ,
"Disable interactive dialog windows in scripts (and use default values "
"instead)" },
{ F|S, "OptionsPositionX" , opt_general_option_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the option "
"window" },
{ F|S, "OptionsPositionY" , opt_general_option_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the option window" },
{ F|O, "Orthographic" , opt_general_orthographic , 1. ,
"Orthographic projection mode (0=perspective projection)" },
{ F|S, "PluginPositionX" , opt_general_plugin_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the plugin "
"window" },
{ F|S, "PluginPositionY" , opt_general_plugin_position1 , 550. ,
"Vertical position (in pixels) of the upper left corner of the plugin window" },
{ F|S, "PluginHeight" , opt_general_plugin_size1 , 300. ,
"Height (in pixels) of the plugin window" },
{ F|S, "PluginWidth" , opt_general_plugin_size0 , 300. ,
"Width (in pixels) of the plugin window" },
{ F|O, "PointSize" , opt_general_point_size , 3. ,
"Display size of points (in pixels)" },
{ F|O, "PolygonOffsetAlwaysOn" , opt_general_polygon_offset_always , 0. ,
"Always apply polygon offset, instead of trying to detect when it is required" },
{ F|O, "PolygonOffsetFactor" , opt_general_polygon_offset_factor ,
#if defined(__APPLE__)
0.5 ,
#else
1.0 ,
#endif
"Polygon offset factor (offset = factor * DZ + r * units)" },
{ F|O, "PolygonOffsetUnits" , opt_general_polygon_offset_units , 1. ,
"Polygon offset units (offset = factor * DZ + r * units)" },
{ F|O, "QuadricSubdivisions" , opt_general_quadric_subdivisions, 6. ,
"Number of subdivisions used to draw points or lines as spheres or cylinders" },
{ F, "RotationX" , opt_general_rotation0 , 0.0 ,
"First Euler angle (used if Trackball=0)" },
{ F, "RotationY" , opt_general_rotation1 , 0.0 ,
"Second Euler angle (used if Trackball=0)" },
{ F, "RotationZ" , opt_general_rotation2 , 0.0 ,
"Third Euler angle (used if Trackball=0)" },
{ F|O, "RotationCenterGravity" , opt_general_rotation_center_cg , 1. ,
"Rotate around the (pseudo) center of mass instead of (RotationCenterX, "
"RotationCenterY, RotationCenterZ)" },
{ F, "RotationCenterX" , opt_general_rotation_center0 , 0.0 ,
"X coordinate of the center of rotation" },
{ F, "RotationCenterY" , opt_general_rotation_center1 , 0.0 ,
"Y coordinate of the center of rotation" },
{ F, "RotationCenterZ" , opt_general_rotation_center2 , 0.0 ,
"Z coordinate of the center of rotation" },
{ F|S, "SaveOptions" , opt_general_options_save, 0. ,
"Automatically save current options in General.OptionsFileName each time "
"you quit Gmsh?" },
{ F|S, "SaveSession" , opt_general_session_save, 1. ,
"Automatically save session specific information in General.SessionFileName "
"each time you quit Gmsh?" },
{ F, "ScaleX" , opt_general_scale0 , 1.0 ,
"X-axis scale factor" },
{ F, "ScaleY" , opt_general_scale1 , 1.0 ,
"Y-axis scale factor" },
{ F, "ScaleZ" , opt_general_scale2 , 1.0 ,
"Z-axis scale factor" },
{ F|O, "Shininess" , opt_general_shine , 0.4 ,
"Material shininess" },
{ F|O, "ShininessExponent" , opt_general_shine_exponent , 40. ,
"Material shininess exponent (between 0 and 128)" },
{ F|O, "SmallAxes" , opt_general_small_axes , 1. ,
"Display the small axes" },
{ F|O, "SmallAxesPositionX" , opt_general_small_axes_position0 , -60. ,
"X position (in pixels) of small axes (< 0: measure from right edge; >= 1e5:"
" centered)" },
{ F|O, "SmallAxesPositionY" , opt_general_small_axes_position1 , -40. ,
"Y position (in pixels) of small axes (< 0: measure from bottom edge; >= 1e5:"
" centered)" },
{ F|O, "SmallAxesSize" , opt_general_small_axes_size , 30. ,
"Size (in pixels) of small axes" },
{ F|S, "SolverPositionX" , opt_general_solver_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the solver "
"windows" },
{ F|S, "SolverPositionY" , opt_general_solver_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the solver windows" },
{ F|S, "StatisticsPositionX" , opt_general_statistics_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the statistic "
"window" },
{ F|S, "StatisticsPositionY" , opt_general_statistics_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the statistic"
" window" },
{ F|O, "Stereo" , opt_general_stereo_mode , 0. ,
"Use stereo rendering" },
{ F|S, "SystemMenuBar" , opt_general_system_menu_bar , 1. ,
"Use the system menu bar on Mac OS X?" },
{ F|O, "Terminal" , opt_general_terminal , 0. ,
"Should information be printed on the terminal (if available)?" },
{ F|O, "Tooltips" , opt_general_tooltips , 1. ,
"Show tooltips in the user interface" },
{ F|O, "Trackball" , opt_general_trackball , 1. ,
"Use trackball rotation mode" },
{ F|O, "TrackballHyperbolicSheet" , opt_general_trackball_hyperbolic_sheet , 1. ,
"Use hyperbolic sheet away from trackball center for z-rotations" },
{ F, "TrackballQuaternion0" , opt_general_quaternion0 , 0.0 ,
"First trackball quaternion component (used if General.Trackball=1)" },
{ F, "TrackballQuaternion1" , opt_general_quaternion1 , 0.0 ,
"Second trackball quaternion component (used if General.Trackball=1)" },
{ F, "TrackballQuaternion2" , opt_general_quaternion2 , 0.0 ,
"Third trackball quaternion component (used if General.Trackball=1)" },
{ F, "TrackballQuaternion3" , opt_general_quaternion3 , 1.0 ,
"Fourth trackball quaternion component (used if General.Trackball=1)" },
{ F, "TranslationX" , opt_general_translation0 , 0.0 ,
"X-axis translation (in model units)" },
{ F, "TranslationY" , opt_general_translation1 , 0.0 ,
"Y-axis translation (in model units)" },
{ F, "TranslationZ" , opt_general_translation2 , 0.0 ,
"Z-axis translation (in model units)" },
{ F|O, "VectorType" , opt_general_vector_type , 4 ,
"Default vector display type (for normals, etc.)" },
{ F|O, "Verbosity" , opt_general_verbosity , 4. ,
"Level of information printed during processing (0=no information)" },
{ F|S, "VisibilityPositionX" , opt_general_visibility_position0 , 650. ,
"Horizontal position (in pixels) of the upper left corner of the visibility "
"window" },
{ F|S, "VisibilityPositionY" , opt_general_visibility_position1 , 150. ,
"Vertical position (in pixels) of the upper left corner of the visibility "
"window" },
{ F|O, "ZoomFactor" , opt_general_zoom_factor , 4.0 ,
"Middle mouse button zoom acceleration factor" },
{ 0, 0 , 0 , 0. , 0 }
} ;
StringXNumber GeometryOptions_Number[] = {
{ F|O, "AutoCoherence" , opt_geometry_auto_coherence , 1. ,
"Should all duplicate entities be automatically removed?" },
{ F, "Clip" , opt_geometry_clip , 0.,
"Enable clipping planes? (Plane[i]=2^i, i=0,...,5)" },
{ F|O, "CopyMeshingMethod" , opt_geometry_copy_meshing_method, 0. ,
"Copy meshing method when duplicating geometrical entities?" },
{ F|O, "ExactExtrusion" , opt_geometry_exact_extrusion, 1. ,
"Use exact extrusion formula in interpolations (set to 0 to allow "
"geometrical transformations of extruded entities)" },
{ F|O, "ExtrudeReturnLateralEntities" , opt_geometry_extrude_return_lateral, 1. ,
"Add lateral entities in lists returned by extrusion commands?" },
{ F|O, "ExtrudeSplinePoints" , opt_geometry_extrude_spline_points, 5. ,
"Number of control points for splines created during extrusion" },
{ F|O, "HighlightOrphans" , opt_geometry_highlight_orphans, 0. ,
"Highlight orphan entities (lines connected to a single surface, etc.)?" },
{ F|O, "Light" , opt_geometry_light , 1. ,
"Enable lighting for the geometry" },
{ F|O, "LightTwoSide" , opt_geometry_light_two_side , 1. ,
"Light both sides of surfaces (leads to slower rendering)" },
{ F|O, "Lines" , opt_geometry_lines , 1. ,
"Display geometry curves?" },
{ F|O, "LineNumbers" , opt_geometry_lines_num , 0. ,
"Display curve numbers?" },
{ F|O, "LineSelectWidth" , opt_geometry_line_sel_width , 2. ,
"Display width of selected lines (in pixels)" },
{ F|O, "LineType" , opt_geometry_line_type , 0. ,
"Display lines as solid color segments (0), 3D cylinders (1) or tapered "
"cylinders (2)" },
{ F|O, "LineWidth" , opt_geometry_line_width , 2. ,
"Display width of lines (in pixels)" },
{ F|O, "MatchGeomAndMesh" , opt_geometry_match_geom_and_mesh, 0 ,
"Matches geometries and meshes." },
{ F|O, "Normals" , opt_geometry_normals , 0. ,
"Display size of normal vectors (in pixels)" },
{ F|O, "NumSubEdges" , opt_geometry_num_sub_edges , 20. ,
"Number of edge subdivisions between control points when displaying curves" },
{ F|O, "OCCFixSmallEdges" , opt_geometry_occ_fix_small_edges , 0. ,
"Fix small edges in STEP, IGES and BRep models" },
{ F|O, "OCCFixSmallFaces" , opt_geometry_occ_fix_small_faces , 0. ,
"Fix small faces in STEP, IGES and BRep models" },
{ F|O, "OCCSewFaces" , opt_geometry_occ_sew_faces , 0. ,
"Sew faces in STEP, IGES and BRep models" },
{ F|O, "OCCConnectFaces" , opt_geometry_occ_connect_faces , 0. ,
"Cut and connect faces in STEP, IGES and BRep models" },
{ F, "OffsetX" , opt_geometry_offset0 , 0. ,
"Model display offset along X-axis (in model coordinates)" },
{ F, "OffsetY" , opt_geometry_offset1 , 0. ,
"Model display offset along Y-axis (in model coordinates)" },
{ F, "OffsetZ" , opt_geometry_offset2 , 0. ,
"Model display offset along Z-axis (in model coordinates)" },
{ F|O, "OldCircle" , opt_geometry_old_circle , 0. ,
"Use old circle description (compatibility option for old Gmsh geometries)" },
{ F|O, "OldNewReg" , opt_geometry_old_newreg , 1. ,
"Use old newreg definition for geometrical transformations (compatibility "
"option for old Gmsh geometries)" },
{ F|O, "Points" , opt_geometry_points , 1. ,
"Display geometry points?" },
{ F|O, "PointNumbers" , opt_geometry_points_num , 0. ,
"Display points numbers?" },
{ F|O, "PointSelectSize" , opt_geometry_point_sel_size , 5. ,
"Display size of selected points (in pixels)" },
{ F|O, "PointSize" , opt_geometry_point_size , 4. ,
"Display size of points (in pixels)" },
{ F|O, "PointType" , opt_geometry_point_type , 0. ,
"Display points as solid color dots (0) or 3D spheres (1)" },
{ F|O, "ScalingFactor" , opt_geometry_scaling_factor , 1.0 ,
"Global geometry scaling factor" },
{ F|O, "SnapX" , opt_geometry_snap0 , 0.1 ,
"Snapping grid spacing along the X-axis" },
{ F|O, "SnapY" , opt_geometry_snap1 , 0.1 ,
"Snapping grid spacing along the Y-axis" },
{ F|O, "SnapZ" , opt_geometry_snap2 , 0.1 ,
"Snapping grid spacing along the Z-axis" },
{ F|O, "Surfaces" , opt_geometry_surfaces , 0. ,
"Display geometry surfaces?" },
{ F|O, "SurfaceNumbers" , opt_geometry_surfaces_num , 0. ,
"Display surface numbers?" },
{ F|O, "SurfaceType" , opt_geometry_surface_type , 2. ,
"Surface display type (0=cross, 1=wireframe, 2=solid)" },
{ F|O, "Tangents" , opt_geometry_tangents , 0. ,
"Display size of tangent vectors (in pixels)" },
{ F|O, "Tolerance" , opt_geometry_tolerance, 1.e-6 ,
"Geometrical tolerance" },
{ F, "Transform" , opt_geometry_transform , 0. ,
"Transform model display coordinates (0=no, 1=scale)" },
{ F, "TransformXX" , opt_geometry_transform00 , 1. ,
"Element (1,1) of the 3x3 model display transformation matrix" },
{ F, "TransformXY" , opt_geometry_transform01 , 0. ,
"Element (1,2) of the 3x3 model display transformation matrix" },
{ F, "TransformXZ" , opt_geometry_transform02 , 0. ,
"Element (1,3) of the 3x3 model display transformation matrix" },
{ F, "TransformYX" , opt_geometry_transform10 , 0. ,
"Element (2,1) of the 3x3 model display transformation matrix" },
{ F, "TransformYY" , opt_geometry_transform11 , 1. ,
"Element (2,2) of the 3x3 model display transformation matrix" },
{ F, "TransformYZ" , opt_geometry_transform12 , 0. ,
"Element (2,3) of the 3x3 model display transformation matrix" },
{ F, "TransformZX" , opt_geometry_transform20 , 0. ,
"Element (3,1) of the 3x3 model display transformation matrix" },
{ F, "TransformZY" , opt_geometry_transform21 , 0. ,
"Element (3,2) of the 3x3 model display transformation matrix" },
{ F, "TransformZZ" , opt_geometry_transform22 , 1. ,
"Element (3,3) of the 3x3 model display transformation matrix" },
{ F|O, "Volumes" , opt_geometry_volumes , 0. ,
"Display geometry volumes? (not implemented yet)" },
{ F|O, "VolumeNumbers" , opt_geometry_volumes_num , 0. ,
"Display volume numbers? (not implemented yet)" },
{ 0, 0 , 0 , 0. , 0 }
} ;
StringXNumber MeshOptions_Number[] = {
{ F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_AUTO ,
"2D mesh algorithm (1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg)" },
{ F|O, "Algorithm3D" , opt_mesh_algo3d ,
#if defined(HAVE_TETGEN)
ALGO_3D_DELAUNAY ,
#else
ALGO_3D_FRONTAL ,
#endif
"3D mesh algorithm (1=Delaunay, 4=Frontal, 5=Frontal Delaunay, 6=Frontal Hex, 7=MMG3D)" },
{ F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 30.0 ,
"Threshold angle below which normals are not smoothed" },
{ F|O, "AnisoMax" , opt_mesh_aniso_max, 1.e33,
"Maximum anisotropy of the mesh" },
{ F|O, "AllowSwapAngle" , opt_mesh_allow_swap_edge_angle , 10.0 ,
"Threshold angle (in degrees) between faces normals under which we allow "
"an edge swap" },
{ F|O, "BdfFieldFormat" , opt_mesh_bdf_field_format , 1. ,
"Field format for Nastran BDF files (0=free, 1=small, 2=large)" },
{ F|O, "Binary" , opt_mesh_binary , 0. ,
"Write mesh files in binary format (if possible)" },
{ F|O, "ChacoArchitecture" , opt_mesh_partition_chaco_architecture, 1. ,
"(Adv. Chaco): Parallel architecture topology (0=hypercube, 1-3=mesh "
"dimensions)" },
{ F|O, "ChacoEigensolver" , opt_mesh_partition_chaco_eigensolver, 1. ,
"(Adv. Chaco): Type of eigensolver for a spectral algorithm (0=Lanczos, "
"1=Multilevel RQI/Symmlq)" },
{ F|O, "ChacoEigTol" , opt_mesh_partition_chaco_eigtol, 1.E-3 ,
"(Adv. Chaco): Tolerance of the eigensolver for spectral or multilevel-KL "
"algorithms" },
{ F|O, "ChacoGlobalMethod" , opt_mesh_partition_chaco_global_method, 1. ,
"Chaco partitioning algorithm (1=Multilevel-KL, 2=Spectral, 4=Linear, "
"5=Random, 6=Scattered)" },
{ F|O, "ChacoHypercubeDim" , opt_mesh_partition_chaco_ndims_tot, 2. ,
"(Adv. Chaco): Dimensional partitioning for a hypercube topology" },
{ F|O, "ChacoLocalMethod" , opt_mesh_partition_chaco_local_method, 1. ,
"(Adv. Chaco): Local partitioning algorithm" },
{ F|O, "ChacoMeshDim1" , opt_mesh_partition_chaco_mesh_dims1, 4. ,
"(Adv. Chaco): Number of partitions in the first dimension of a mesh topology" },
{ F|O, "ChacoMeshDim2" , opt_mesh_partition_chaco_mesh_dims2, 1. ,
"(Adv. Chaco): Number of partitions in the second dimension of a mesh topology" },
{ F|O, "ChacoMeshDim3" , opt_mesh_partition_chaco_mesh_dims3, 1. ,
"(Adv. Chaco): Number of partitions in the third dimension of a mesh topology" },
{ F|O, "ChacoPartitionSection" , opt_mesh_partition_chaco_nsection, 1. ,
"(Adv. Chaco): Partition by (1=bisection, 2=quadrisection, 3=octasection" },
{ F|O, "ChacoSeed" , opt_mesh_partition_chaco_seed, 7654321. ,
"(Adv. Chaco): Seed for random number generator" },
{ F|O, "ChacoVMax" , opt_mesh_partition_chaco_vmax, 250. ,
"(Adv. Chaco): Maximum vertices in a coarse graph (for multilevel-KL "
"algorithm and Multilevel RQI/Symmlq eigensolver)" },
{ F|O, "ChacoParamINTERNAL_VERTICES" ,
opt_mesh_partition_chaco_internal_vertices, 0. ,
"(Adv. Chaco): Parameter INTERNAL_VERTICES" },
{ F|O, "ChacoParamREFINE_MAP" , opt_mesh_partition_chaco_refine_map, 1. ,
"(Adv. Chaco): Parameter REFINE_MAP" },
{ F|O, "ChacoParamREFINE_PARTITION" ,
opt_mesh_partition_chaco_refine_partition, 0. ,
"(Adv. Chaco): Parameter REFINE_PARTITION" },
{ F|O, "ChacoParamTERMINAL_PROPOGATION" ,
opt_mesh_partition_chaco_terminal_propogation, 0. ,
"(Adv. Chaco): Parameter TERMINAL_PROPOGATION" },
{ F|O, "CharacteristicLengthExtendFromBoundary" ,
opt_mesh_lc_extend_from_boundary, 1. ,
"Extend computation of mesh element sizes from the boundaries into the surfaces/volumes" },
{ F|O, "CharacteristicLengthFactor" , opt_mesh_lc_factor , 1.0 ,
"Factor applied to all mesh element sizes" },
{ F|O, "CharacteristicLengthMin" , opt_mesh_lc_min, 0.0 ,
"Minimum mesh element size" },
{ F|O, "CharacteristicLengthMax" , opt_mesh_lc_max, 1.e22,
"Maximum mesh element size" },
{ F|O, "CharacteristicLengthFromCurvature" , opt_mesh_lc_from_curvature , 0. ,
"Automatically compute mesh element sizes from curvature (experimental)" },
{ F|O, "CharacteristicLengthFromPoints" , opt_mesh_lc_from_points , 1. ,
"Compute mesh element sizes from values given at geometry points" },
{ F, "Clip" , opt_mesh_clip , 0.,
"Enable clipping planes? (Plane[i]=2^i, i=0,...,5)" },
{ F|O, "ColorCarousel" , opt_mesh_color_carousel , 1. ,
"Mesh coloring (0=by element type, 1=by elementary entity, 2=by physical "
"entity, 3=by partition)" },
{ F, "CpuTime" , opt_mesh_cpu_time , 0. ,
"CPU time (in seconds) for the generation of the current mesh (read-only)" },
{ F|O, "DrawSkinOnly" , opt_mesh_draw_skin_only , 0. ,
"Draw only the skin of 3D meshes?" },
{ F|O, "Dual" , opt_mesh_dual , 0. ,
"Display the dual mesh obtained by barycentric subdivision" },
{ F|O, "ElementOrder" , opt_mesh_order , 1. ,
// "Order" is a reserved token in the parser
"Element order (1=linear elements, N (<6) = elements of higher order)" },
{ F|O, "Explode" , opt_mesh_explode , 1.0 ,
"Element shrinking factor (between 0 and 1)" },
{ F|O, "Format" , opt_mesh_file_format , FORMAT_AUTO ,
"Mesh output format (1=msh, 2=unv, 10=automatic, 19=vrml, 27=stl, 30=mesh, 31=bdf, "
"32=cgns, 33=med, 40=ply2)" },
{ F|O, "Hexahedra" , opt_mesh_hexahedra , 1. ,
"Display mesh hexahedra?" },
{ F|O, "HighOrderNoMetric" , opt_mesh_hom_no_metric , 0. ,
"Don't use metric computation to create high-order meshes." },
{ F|O, "LabelSampling" , opt_mesh_label_sampling , 1. ,
"Label sampling rate (display one label every `LabelSampling' elements)" },
{ F|O, "LabelType" , opt_mesh_label_type , 0. ,
"Type of element label (0=element number, 1=elementary entity number, "
"2=physical entity number, 3=partition number, 4=coordinates)" },
{ F|O, "LcIntegrationPrecision" , opt_mesh_lc_integration_precision, 1.e-9 ,
"Accuracy of evaluation of the LC field for 1D mesh generation" },
{ F|O, "Light" , opt_mesh_light , 1. ,
"Enable lighting for the mesh" },
{ F|O, "LightLines" , opt_mesh_light_lines , 1. ,
"Enable lighting for mesh lines (element edges)" },
{ F|O, "LightTwoSide" , opt_mesh_light_two_side , 1. ,
"Light both sides of surfaces (leads to slower rendering)" },
{ F|O, "Lines" , opt_mesh_lines , 0. ,
"Display mesh lines (1D elements)?" },
{ F|O, "LineNumbers" , opt_mesh_lines_num , 0. ,
"Display mesh line numbers?" },
{ F|O, "LineWidth" , opt_mesh_line_width , 1.0 ,
"Display width of mesh lines (in pixels)" },
{ F|O, "MeshOnlyVisible" , opt_mesh_mesh_only_visible, 0. ,
"Mesh only visible entities (experimental: use with caution!)" },
{ F|O, "MetisAlgorithm" , opt_mesh_partition_metis_algorithm, 1. ,
"METIS partitioning algorithm (1=Recursive, 2=K-way, 3=Nodal weight)" },
{ F|O, "MetisEdgeMatching" , opt_mesh_partition_metis_edge_matching, 3. ,
"(Adv. METIS): Determines the matching type (1=Random, 2=Heavy-Edge, "
"3=Sorted Heavy-Edge)" },
{ F|O, "MetisRefinementAlgorithm" , opt_mesh_partition_metis_refine_algorithm, 3. ,
"(Adv. METIS): Algorithm for k-way refinement (1=Random, 2=Greedy, "
"3=Random with minimized connectivity)" },
{ F|O, "MinimumCirclePoints" , opt_mesh_min_circ_points, 7. ,
"Minimum number of points used to mesh a circle" },
{ F|O, "MinimumCurvePoints" , opt_mesh_min_curv_points, 3. ,
"Minimum number of points used to mesh a (non-straight) curve" },
{ F|O, "MshFileVersion" , opt_mesh_msh_file_version , 2.2 ,
"Version of the MSH file format to use" },
{ F|O, "MshFilePartitioned" , opt_mesh_msh_file_partitioned , 0. ,
"Split MSH file by mesh partition" },
{ F|O, "MultiplePassesMeshes" , opt_mesh_multiple_passes , 0. ,
"Do a first simple mesh and use it for complex background meshes (curvatures...)" },
{ F|O, "PartitionHexWeight" , opt_mesh_partition_hex_weight , 1 ,
"Weight of hexahedral element for METIS load balancing" },
{ F|O, "PartitionPrismWeight" , opt_mesh_partition_pri_weight , 1 ,
"Weight of prismatic element (wedge) for METIS load balancing" },
{ F|O, "PartitionPyramidWeight" , opt_mesh_partition_pyr_weight , 1 ,
"Weight of pyramidal element for METIS load balancing" },
{ F|O, "PartitionQuadWeight" , opt_mesh_partition_qua_weight , 1 ,
"Weight of quadrangle for METIS load balancing" },
{ F|O, "PartitionTetWeight" , opt_mesh_partition_tet_weight , 1 ,
"Weight of tetrahedral element for METIS load balancing" },
{ F|O, "PartitionTriWeight" , opt_mesh_partition_tri_weight , 1 ,
"Weight of triangle for METIS load balancing" ,},
{ F, "NbHexahedra" , opt_mesh_nb_hexahedra , 0. ,
"Number of hexahedra in the current mesh (read-only)" },
{ F, "NbNodes" , opt_mesh_nb_nodes , 0. ,
"Number of nodes in the current mesh (read-only)" },
{ F|O, "NbPartitions" , opt_mesh_partition_num, 1. ,
"Number of partitions" },
{ F, "NbPrisms" , opt_mesh_nb_prisms , 0. ,
"Number of prisms in the current mesh (read-only)" },
{ F, "NbPyramids" , opt_mesh_nb_pyramids , 0. ,
"Number of pyramids in the current mesh (read-only)" },
{ F, "NbQuadrangles" , opt_mesh_nb_quadrangles , 0. ,
"Number of quadrangles in the current mesh (read-only)" },
{ F, "NbTetrahedra" , opt_mesh_nb_tetrahedra , 0. ,
"Number of tetrahedra in the current mesh (read-only)" },
{ F, "NbTriangles" , opt_mesh_nb_triangles , 0. ,
"Number of triangles in the current mesh (read-only)" },
{ F|O, "Normals" , opt_mesh_normals , 0.0 ,
"Display size of normal vectors (in pixels)" },
{ F|O, "NumSubEdges" , opt_mesh_num_sub_edges , 2. ,
"Number of edge subdivisions when displaying high order elements" },
{ F|O, "Optimize" , opt_mesh_optimize , 0. ,
"Optimize the mesh to improve the quality of tetrahedral elements" },
{ F|O, "OptimizeNetgen" , opt_mesh_optimize_netgen , 0. ,
"Optimize the mesh using Netgen to improve the quality of tetrahedral "
"elements" },
{ F|O, "Partitioner" , opt_mesh_partition_partitioner, 2. ,
"Partitioner software (1=Chacho, 2=METIS)" },
{ F|O, "Points" , opt_mesh_points , 0. ,
"Display mesh vertices (nodes)?" },
{ F|O, "PointNumbers" , opt_mesh_points_num , 0. ,
"Display mesh node numbers?" },
{ F|O, "PointSize" , opt_mesh_point_size , 4. ,
"Display size of mesh vertices (in pixels)" },
{ F|O, "PointType" , opt_mesh_point_type , 0. ,
"Display mesh vertices as solid color dots (0) or 3D spheres (1)" },
{ F|O, "Prisms" , opt_mesh_prisms , 1. ,
"Display mesh prisms?" },
{ F|O, "Pyramids" , opt_mesh_pyramids , 1. ,
"Display mesh pyramids?" },
{ F|O, "Quadrangles" , opt_mesh_quadrangles , 1. ,
"Display mesh quadrangles?" },
{ F|O, "QualityInf" , opt_mesh_quality_inf , 0.0 ,
"Only display elements whose quality measure is greater than QualityInf" },
{ F|O, "QualitySup" , opt_mesh_quality_sup , 0.0 ,
"Only display elements whose quality measure is smaller than QualitySup" },
{ F|O, "QualityType" , opt_mesh_quality_type , 2. ,
"Type of quality measure (0=gamma~vol/sum_face/max_edge, "
"1=eta~vol^(2/3)/sum_edge^2, 2=rho~min_edge/max_edge)" },
{ F|O, "RadiusInf" , opt_mesh_radius_inf , 0.0 ,
"Only display elements whose longest edge is greater than RadiusInf" },
{ F|O, "RadiusSup" , opt_mesh_radius_sup , 0.0 ,
"Only display elements whose longest edge is smaller than RadiusSup" },
{ F|O, "RandomFactor" , opt_mesh_rand_factor , 1.e-9 ,
"Random factor used in the 2D meshing algorithm (should be increased if "
"RandomFactor * size(triangle)/size(model) approaches machine accuracy)" },
{ F|O, "RecombinationAlgorithm" , opt_mesh_algo_recombine , 0 ,
"Mesh recombination algorithm (0=standard, 1=blossom)" },
{ F|O, "RecombineAll" , opt_mesh_recombine_all , 0 ,
"Apply recombination algorithm to all surfaces, ignoring per-surface spec" },
{ F|O, "RemeshAlgorithm" , opt_mesh_remesh_algo , 0 ,
"Remeshing algorithm (0=no split, 1=automatic, 2=automatic only with metis)" },
{ F|O, "RemeshParametrization" , opt_mesh_remesh_param , 0 ,
"Remsh Parametrization (0=harmonic, 1=conformal, 2=rbf harmonic)" },
{ F|O, "RefineSteps" , opt_mesh_refine_steps , 10 ,
"Number of refinement steps in the MeshAdapt-based 2D algorithms" },
{ F|O, "Remove4Triangles" , opt_mesh_remove_4_triangles , 0 ,
"Try to remove nodes surrounded by 4 triangles in 2D triangular meshes" },
{ F|O, "ReverseAllNormals" , opt_mesh_reverse_all_normals , 0. ,
"Reverse all the mesh normals (for display)" },
{ F, "SaveAll" , opt_mesh_save_all , 0. ,
"Ignore Physical definitions and save all elements" },
{ F|O, "SaveElementTagType" , opt_mesh_save_element_tag_type , 1. ,
"Type of the element tag saved in mesh formats that don't support saving "
"physical or partition ids (1=elementary, 2=physical, 3=partition)" },
{ F|O, "SaveParametric" , opt_mesh_save_parametric , 0. ,
"Save parametric coordinates of nodes" },
{ F|O, "SaveGroupsOfNodes" , opt_mesh_save_groups_of_nodes , 0. ,
"Save groups of nodes for each physical line and surface (UNV mesh "
"format only)" },
{ F|O, "ScalingFactor" , opt_mesh_scaling_factor , 1.0 ,
"Global scaling factor applied to the saved mesh" },
{ F|O, "SecondOrderExperimental" , opt_mesh_second_order_experimental , 0. ,
"Use experimental code to generate second order mesh" },
{ F|O, "SecondOrderIncomplete" , opt_mesh_second_order_incomplete , 0. ,
"Create incomplete second order elements? (8-node quads, 20-node hexas, etc.)" },
{ F|O, "SecondOrderLinear" , opt_mesh_second_order_linear , 0. ,
"Should second order vertices simply be created by linear interpolation?" },
{ F|O, "Smoothing" , opt_mesh_nb_smoothing , 1. ,
"Number of smoothing steps applied to the final mesh" },
{ F|O, "SmoothInternalEdges" , opt_mesh_smooth_internal_edges , 0 ,
"Number of smoothing steps of internal edges for high order meshes" },
{ F|O, "SmoothNormals" , opt_mesh_smooth_normals , 0. ,
"Smooth the mesh normals?" },
{ F|O, "SmoothRatio" , opt_mesh_smooth_ratio , 1.8 ,
"Ratio between mesh sizes at vertices of a same edeg (used in BAMG)" },
{ F|O, "SubdivisionAlgorithm" , opt_mesh_algo_subdivide , 0 ,
"Mesh subdivision algorithm (0=none, 1=all quadrangles, 2=all hexahedra)" },
{ F|O, "SurfaceEdges" , opt_mesh_surfaces_edges , 1. ,
"Display edges of surface mesh?" },
{ F|O, "SurfaceFaces" , opt_mesh_surfaces_faces , 0. ,
"Display faces of surface mesh?" },
{ F|O, "SurfaceNumbers" , opt_mesh_surfaces_num , 0. ,
"Display surface mesh element numbers?" },
{ F|O, "SwitchElementTags", opt_mesh_switch_elem_tags, 0. ,
"Invert elementary and physical tags when reading the mesh"},
{ F|O, "Tangents" , opt_mesh_tangents , 0.0 ,
"Display size of tangent vectors (in pixels)" },
{ F|O, "Tetrahedra" , opt_mesh_tetrahedra , 1. ,
"Display mesh tetrahedra?" },
{ F|O, "ToleranceEdgeLength" , opt_mesh_tolerance_edge_length, 0.0,
"Skip a model edge in mesh generation if its length is less than user's "
"defined tolerance" },
{ F|O, "Triangles" , opt_mesh_triangles , 1. ,
"Display mesh triangles?" },
{ F|O, "VolumeEdges" , opt_mesh_volumes_edges , 1. ,
"Display edges of volume mesh?" },
{ F|O, "VolumeFaces" , opt_mesh_volumes_faces , 0. ,
"Display faces of volume mesh?" },
{ F|O, "VolumeNumbers" , opt_mesh_volumes_num , 0. ,
"Display volume mesh element numbers?" },
{ F|O, "Voronoi" , opt_mesh_voronoi , 0. ,
"Display the voronoi diagram" },
{ F|O, "ZoneDefinition" , opt_mesh_zone_definition , 0. ,
"Method for defining a zone (0=single zone, 1=by partition, 2=by physical)" },
{ 0, 0 , 0 , 0. , 0 }
} ;
StringXNumber SolverOptions_Number[] = {
{ F|O, "AlwaysListen" , opt_solver_listen , 0. ,
"Always listen to incoming connection requests?" },
{ F|O, "ClientServer0" , opt_solver_client_server0 , 1. ,
"Connect solver 0 to the Gmsh server" },
{ F|O, "ClientServer1" , opt_solver_client_server1 , 0. ,
"Connect solver 1 to the Gmsh server" },
{ F|O, "ClientServer2" , opt_solver_client_server2 , 0. ,
"Connect solver 2 to the Gmsh server" },
{ F|O, "ClientServer3" , opt_solver_client_server3 , 0. ,
"Connect solver 3 to the Gmsh server" },
{ F|O, "ClientServer4" , opt_solver_client_server4 , 0. ,
"Connect solver 4 to the Gmsh server" },
{ F|O, "MergeViews0" , opt_solver_merge_views0 , 1. ,
"Automatically merge any post-processing view created by solver 0" },
{ F|O, "MergeViews1" , opt_solver_merge_views1 , 1. ,
"Automatically merge any post-processing view created by solver 1" },
{ F|O, "MergeViews2" , opt_solver_merge_views2 , 1. ,
"Automatically merge any post-processing view created by solver 2" },
{ F|O, "MergeViews3" , opt_solver_merge_views3 , 1. ,
"Automatically merge any post-processing view created by solver 3" },
{ F|O, "MergeViews4" , opt_solver_merge_views4 , 1. ,
"Automatically merge any post-processing view created by solver 4" },
{ F|O, "Plugins" , opt_solver_plugins , 0. ,
"Enable default solver plugins?" },
{ F|O, "PopupMessages0" , opt_solver_popup_messages0 , 1. ,
"Automatically display messages produced by solver 0" },
{ F|O, "PopupMessages1" , opt_solver_popup_messages1 , 1. ,
"Automatically display messages produced by solver 1" },
{ F|O, "PopupMessages2" , opt_solver_popup_messages2 , 1. ,
"Automatically display messages produced by solver 2" },
{ F|O, "PopupMessages3" , opt_solver_popup_messages3 , 1. ,
"Automatically display messages produced by solver 3" },
{ F|O, "PopupMessages4" , opt_solver_popup_messages4 , 1. ,
"Automatically display messages produced by solver 4" },
{ F|O, "Timeout" , opt_solver_timeout , 5. ,
"Time (in seconds) before closing the socket if no connection is happening." },
{ 0, 0 , 0 , 0. , 0 }
} ;
StringXNumber PostProcessingOptions_Number[] = {
{ F|O, "AnimationDelay" , opt_post_anim_delay , 0.1 ,
"Delay (in seconds) between frames in automatic animation mode" },
{ F|O, "AnimationCycle" , opt_post_anim_cycle , 0. ,
"Cycle through time steps (0) or views (1) for animations" },
{ F|O, "CombineRemoveOriginal" , opt_post_combine_remove_orig , 1. ,
"Remove original views after a Combine operation" },
{ F|O, "Format" , opt_post_file_format , 10. ,
"Default file format for post-processing views (0=ASCII view, 1=binary "
"view, 2=parsed view, 3=STL triangulation, 4=raw text, 5=Gmsh mesh, 6=MED file, "
"10=automatic)" },
{ F|O, "HorizontalScales" , opt_post_horizontal_scales , 1. ,
"Display value scales horizontally" },
{ F|O, "Link" , opt_post_link , 0. ,
"Link post-processing views (0=none, 1/2=changes in visible/all, "
"3/4=everything in visible/all)" },
{ F, "NbViews" , opt_post_nb_views , 0. ,
"Current number of views merged (read-only)" },
{ F|O, "Plugins" , opt_post_plugins , 1. ,
"Enable default post-processing plugins?" },
{ F|O, "Smoothing" , opt_post_smooth , 0. ,
"Apply (non-reversible) smoothing to post-processing view when merged" },
{ 0, 0 , 0 , 0. }
} ;
StringXNumber ViewOptions_Number[] = {
{ F|O, "AdaptVisualizationGrid" , opt_view_adapt_visualization_grid , 0. ,
"Use adaptive visualization grid (for high-order elements)?" },
{ F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 30.0 ,
"Threshold angle below which normals are not smoothed" },
{ F|O, "ArrowSizeMax" , opt_view_arrow_size_max , 60. ,
"Maximum display size of arrows (in pixels)" },
{ F|O, "ArrowSizeMin" , opt_view_arrow_size_min , 0. ,
"Minimum display size of arrows (in pixels)" },
{ F|O, "AutoPosition" , opt_view_auto_position , 1. ,
"Position the scale or 2D plot automatically" },
{ F|O, "Axes" , opt_view_axes , 0 ,
"Axes (0=none, 1=simple axes, 2=box, 3=full grid, 4=open grid, 5=ruler)" },
{ F|O, "AxesMikado" , opt_view_axes_mikado , 0. ,
"Mikado axes style" },
{ F|O, "AxesAutoPosition" , opt_view_axes_auto_position , 1. ,
"Position the axes automatically" },
{ F|O, "AxesMaxX" , opt_view_axes_xmax , 1. ,
"Maximum X-axis coordinate" },
{ F|O, "AxesMaxY" , opt_view_axes_ymax , 1. ,
"Maximum Y-axis coordinate" },
{ F|O, "AxesMaxZ" , opt_view_axes_zmax , 1. ,
"Maximum Z-axis coordinate" },
{ F|O, "AxesMinX" , opt_view_axes_xmin , 0. ,
"Minimum X-axis coordinate" },
{ F|O, "AxesMinY" , opt_view_axes_ymin , 0. ,
"Minimum Y-axis coordinate" },
{ F|O, "AxesMinZ" , opt_view_axes_zmin , 0. ,
"Minimum Z-axis coordinate" },
{ F|O, "AxesTicsX" , opt_view_axes_tics0 , 5. ,
"Number of tics on the X-axis" },
{ F|O, "AxesTicsY" , opt_view_axes_tics1 , 5. ,
"Number of tics on the Y-axis" },
{ F|O, "AxesTicsZ" , opt_view_axes_tics2 , 5. ,
"Number of tics on the Z-axis" },
{ F|O, "Boundary" , opt_view_boundary , 0. ,
"Draw the `N minus b'-dimensional boundary of the element (N=element "
"dimension, b=option value)" },
{ F|O, "CenterGlyphs" , opt_view_center_glyphs , 0,
"Center glyphs (arrows, numbers, etc.)? (0=left, 1=centered, 2=right)" },
{ F, "Clip" , opt_view_clip , 0.,
"Enable clipping planes? (Plane[i]=2^i, i=0,...,5)" },
{ F|O, "ColormapAlpha" , opt_view_colormap_alpha , 1.0 ,
"Colormap alpha channel value (used only if != 1)" },
{ F|O, "ColormapAlphaPower" , opt_view_colormap_alpha_power , 0.0 ,
"Colormap alpha channel power" },
{ F|O, "ColormapBeta" , opt_view_colormap_beta , 0.0 ,
"Colormap beta parameter (gamma = 1-beta)" },
{ F|O, "ColormapBias" , opt_view_colormap_bias , 0.0 ,
"Colormap bias" },
{ F|O, "ColormapCurvature" , opt_view_colormap_curvature , 0.0 ,
"Colormap curvature or slope coefficient" },
{ F|O, "ColormapInvert" , opt_view_colormap_invert , 0. ,
"Invert the color values, i.e., replace x with (255-x) in the colormap?" },
{ F|O, "ColormapNumber" , opt_view_colormap_number , 2. ,
"Default colormap number" },
{ F|O, "ColormapRotation" , opt_view_colormap_rotation , 0. ,
"Incremental colormap rotation" },
{ F|O, "ColormapSwap" , opt_view_colormap_swap , 0. ,
"Swap the min/max values in the colormap?" },
{ F|O, "ComponentMap0" , opt_view_component_map0 , 0,
"Forced component 0 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap1" , opt_view_component_map1 , 1,
"Forced component 1 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap2" , opt_view_component_map2 , 2,
"Forced component 2 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap3" , opt_view_component_map3 , 3,
"Forced component 3 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap4" , opt_view_component_map4 , 4,
"Forced component 4 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap5" , opt_view_component_map5 , 5,
"Forced component 5 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap6" , opt_view_component_map6 , 6,
"Forced component 6 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap7" , opt_view_component_map7 , 7,
"Forced component 7 (if View.ForceComponents > 0)" },
{ F|O, "ComponentMap8" , opt_view_component_map8 , 8,
"Forced component 8 (if View.ForceComponents > 0)" },
{ F, "CustomMax" , opt_view_custom_max , 0. ,
"User-defined maximum value to be displayed" },
{ F, "CustomMin" , opt_view_custom_min , 0. ,
"User-defined minimum value to be displayed" },
{ F|O, "DisplacementFactor" , opt_view_displacement_factor , 1. ,
"Displacement amplification" },
{ F|O, "DrawHexahedra" , opt_view_draw_hexahedra , 1. ,
"Display post-processing hexahedra?" },
{ F|O, "DrawLines" , opt_view_draw_lines , 1. ,
"Display post-processing lines?" },
{ F|O, "DrawPoints" , opt_view_draw_points , 1. ,
"Display post-processing points?" },
{ F|O, "DrawPrisms" , opt_view_draw_prisms , 1. ,
"Display post-processing prisms?" },
{ F|O, "DrawPyramids" , opt_view_draw_pyramids , 1. ,
"Display post-processing pyramids?" },
{ F|O, "DrawQuadrangles" , opt_view_draw_quadrangles , 1. ,
"Display post-processing quadrangles?" },
{ F|O, "DrawScalars" , opt_view_draw_scalars , 1. ,
"Display scalar values?" },
{ F|O, "DrawSkinOnly" , opt_view_draw_skin_only , 0. ,
"Draw only the skin of 3D scalar views?" },
{ F|O, "DrawStrings" , opt_view_draw_strings , 1. ,
"Display post-processing annotation strings?" },
{ F|O, "DrawTensors" , opt_view_draw_tensors , 1. ,
"Display tensor values?" },
{ F|O, "DrawTetrahedra" , opt_view_draw_tetrahedra , 1. ,
"Display post-processing tetrahedra?" },
{ F|O, "DrawTriangles" , opt_view_draw_triangles , 1. ,
"Display post-processing triangles?" },
{ F|O, "DrawVectors" , opt_view_draw_vectors , 1. ,
"Display vector values?" },
{ F|O, "Explode" , opt_view_explode , 1. ,
"Element shrinking factor (between 0 and 1)" },
{ F|O, "ExternalView" , opt_view_external_view , -1. ,
"Index of the view used to color vector fields (-1=self)" },
{ F|O, "FakeTransparency" , opt_view_fake_transparency , 0. ,
"Use fake transparency (cheaper than the real thing, but incorrect)" },
{ F|O, "ForceNumComponents" , opt_view_force_num_components , 0. ,
"Force number of components to display (see View.ComponentMapN for mapping)" },
{ F|O, "GeneralizedRaiseFactor" , opt_view_gen_raise_factor , 1. ,
"Generalized raise amplification factor" },
{ F|O, "GeneralizedRaiseView" , opt_view_gen_raise_view , -1. ,
"Index of the view used for generalized raise (-1=self)" },
{ F|O, "GlyphLocation" , opt_view_glyph_location , 1,
"Glyph (arrow, number, etc.) location (1=center of gravity, 2=node)" },
{ F|O, "Height" , opt_view_size1 , 200. ,
"Height (in pixels) of the scale or 2D plot" },
{ F|O, "IntervalsType" , opt_view_intervals_type , 2 ,
"Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)" },
{ F|O, "Light" , opt_view_light , 1. ,
"Enable lighting for the view" },
{ F|O, "LightLines" , opt_view_light_lines , 1. ,
"Light element edges" },
{ F|O, "LightTwoSide" , opt_view_light_two_side , 1. ,
"Light both sides of surfaces (leads to slower rendering)" },
{ F|O, "LineType" , opt_view_line_type , 0. ,
"Display lines as solid color segments (0) or 3D cylinders (1)" },
{ F|O, "LineWidth" , opt_view_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ F|O, "MaxRecursionLevel" , opt_view_max_recursion_level , 0. ,
"Maximum recursion level for adaptive views" },
{ F, "Max" , opt_view_max , 0. ,
"Maximum value in the view (read-only)" },
{ F, "MaxX" , opt_view_xmax , 0. ,
"Maximum view coordinate along the X-axis (read-only)" },
{ F, "MaxY" , opt_view_ymax , 0. ,
"Maximum view coordinate along the Y-axis (read-only)" },
{ F, "MaxZ" , opt_view_zmax , 0. ,
"Maximum view coordinate along the Z-axis (read-only)" },
{ F, "Min" , opt_view_min , 0. ,
"Minimum value in the view (read-only)" },
{ F, "MinX" , opt_view_xmin , 0. ,
"Minimum view coordinate along the X-axis (read-only)" },
{ F, "MinY" , opt_view_ymin , 0. ,
"Minimum view coordinate along the Y-axis (read-only)" },
{ F, "MinZ" , opt_view_zmin , 0. ,
"Minimum view coordinate along the Z-axis (read-only)" },
{ F|O, "NbIso" , opt_view_nb_iso , 10. ,
"Number of intervals" },
{ F, "NbTimeStep" , opt_view_nb_timestep , 1. ,
"Number of time steps in the view (do not change this!)" },
{ F, "NormalRaise" , opt_view_normal_raise , 0. ,
"Elevation of the view along the normal (in model coordinates)" },
{ F|O, "Normals" , opt_view_normals , 0. ,
"Display size of normal vectors (in pixels)" },
{ F, "OffsetX" , opt_view_offset0 , 0. ,
"Translation of the view along X-axis (in model coordinates)" },
{ F, "OffsetY" , opt_view_offset1 , 0. ,
"Translation of the view along Y-axis (in model coordinates)" },
{ F, "OffsetZ" , opt_view_offset2 , 0. ,
"Translation of the view along Z-axis (in model coordinates)" },
{ F|O, "PointSize" , opt_view_point_size , 3. ,
"Display size of points (in pixels)" },
{ F|O, "PointType" , opt_view_point_type , 0. ,
"Display points as solid color dots (0), 3D spheres (1), scaled dots "
"(2) or scaled spheres (3)" },
{ F|O, "PositionX" , opt_view_position0 , 100. ,
"X position (in pixels) of the scale or 2D plot (< 0: measure from right "
"edge; >= 1e5: centered)" },
{ F|O, "PositionY" , opt_view_position1 , 50. ,
"Y position (in pixels) of the scale or 2D plot (< 0: measure from bottom "
"edge; >= 1e5: centered)" },
{ F, "RaiseX" , opt_view_raise0 , 0. ,
"Elevation of the view along X-axis (in model coordinates)" },
{ F, "RaiseY" , opt_view_raise1 , 0. ,
"Elevation of the view along Y-axis (in model coordinates)" },
{ F, "RaiseZ" , opt_view_raise2 , 0. ,
"Elevation of the view along Z-axis (in model coordinates)" },
{ F|O, "RangeType" , opt_view_range_type , 1 ,
"Value scale range type (1=default, 2=custom, 3=per time step)" },
{ F|O, "Sampling" , opt_view_sampling , 1. ,
"Element sampling rate (draw one out every `Sampling' elements)" },
{ F|O, "SaturateValues" , opt_view_saturate_values , 0. ,
"Saturate the view values to custom min and max (1=true, 0=false)" },
{ F|O, "ScaleType" , opt_view_scale_type , 1 ,
"Value scale type (1=linear, 2=logarithmic, 3=double logarithmic)" },
{ F|O, "ShowElement" , opt_view_show_element , 0. ,
"Show element boundaries?" },
{ F|O, "ShowScale" , opt_view_show_scale , 1. ,
"Show value scale?" },
{ F|O, "ShowTime" , opt_view_show_time , 3. ,
"Time display mode (0=hidden, 1=time value if multi-step, 2=time value always, "
"3=time step if multi-step, 4=time step always)" },
{ F|O, "SmoothNormals" , opt_view_smooth_normals , 0. ,
"Smooth the normals?" },
{ F|O, "Stipple" , opt_view_use_stipple , 0. ,
"Stipple curves in 2D plots?" },
{ F|O, "Tangents" , opt_view_tangents , 0. ,
"Display size of tangent vectors (in pixels)" },
{ F|O, "TargetError" , opt_view_target_error , 0.01 ,
"Target representation error for adaptive views" },
{ F|O, "TensorType" , opt_view_tensor_type , 1. ,
"Tensor Visualization Type" },
{ F, "TimeStep" , opt_view_timestep , 0. ,
"Current time step displayed" },
{ F, "TransformXX" , opt_view_transform00 , 1. ,
"Element (1,1) of the 3x3 coordinate transformation matrix" },
{ F, "TransformXY" , opt_view_transform01 , 0. ,
"Element (1,2) of the 3x3 coordinate transformation matrix" },
{ F, "TransformXZ" , opt_view_transform02 , 0. ,
"Element (1,3) of the 3x3 coordinate transformation matrix" },
{ F, "TransformYX" , opt_view_transform10 , 0. ,
"Element (2,1) of the 3x3 coordinate transformation matrix" },
{ F, "TransformYY" , opt_view_transform11 , 1. ,
"Element (2,2) of the 3x3 coordinate transformation matrix" },
{ F, "TransformYZ" , opt_view_transform12 , 0. ,
"Element (2,3) of the 3x3 coordinate transformation matrix" },
{ F, "TransformZX" , opt_view_transform20 , 0. ,
"Element (3,1) of the 3x3 coordinate transformation matrix" },
{ F, "TransformZY" , opt_view_transform21 , 0. ,
"Element (3,2) of the 3x3 coordinate transformation matrix" },
{ F, "TransformZZ" , opt_view_transform22 , 1. ,
"Element (3,3) of the 3x3 coordinate transformation matrix" },
{ F, "Type" , opt_view_type , 1 ,
"Type of plot (1=3D, 2=2D space, 3=2D time)" },
{ F|O, "UseGeneralizedRaise" , opt_view_use_gen_raise , 0 ,
"Use generalized raise?" },
{ F|O, "VectorType" , opt_view_vector_type , 4 ,
"Vector display type (1=segment, 2=arrow, 3=pyramid, 4=3D arrow, "
"5=displacement, 6=comet)" },
{ F, "Visible" , opt_view_visible , 1. ,
"Is the view visible?" },
{ F|O, "Width" , opt_view_size0 , 300. ,
"Width (in pixels) of the scale or 2D plot" },
{ 0, 0 , 0 , 0. , 0 }
} ;
StringXNumber PrintOptions_Number[] = {
{ F|O, "CompositeWindows" , opt_print_composite_windows , 0. ,
"Composite all window tiles in the same output image (for bitmap output only)" },
{ F|O, "DeleteTemporaryFiles" , opt_print_delete_tmp_files , 1. ,
"Delete temporary files used during printing" },
{ F|O, "EpsBackground" , opt_print_eps_background , 1. ,
"Save image background in PostScript/PDF output" },
{ F|O, "EpsBestRoot" , opt_print_eps_best_root , 1. ,
"Try to minimize primitive splitting in BSP tree sorted PostScript/PDF output" },
{ F|O, "EpsCompress" , opt_print_eps_compress , 0. ,
"Compress PostScript/PDF output using zlib" },
{ F|O, "EpsLineWidthFactor" , opt_print_eps_line_width_factor , 1.0 ,
"Width factor for lines in PostScript/PDF output" },
{ F|O, "EpsOcclusionCulling" , opt_print_eps_occlusion_culling , 1. ,
"Cull occluded primitives (to reduce PostScript/PDF file size)" },
{ F|O, "EpsPointSizeFactor" , opt_print_eps_point_size_factor , 1.0 ,
"Size factor for points in PostScript/PDF output" },
{ F|O, "EpsPS3Shading" , opt_print_eps_ps3shading , 0. ,
"Enable PostScript Level 3 shading" },
{ F|O, "EpsQuality" , opt_print_eps_quality , 1. ,
"PostScript/PDF quality (0=bitmap, 1=vector (simple sort), 2=vector "
"(accurate sort), 3=vector (unsorted)" },
{ F|O, "Format" , opt_print_file_format , FORMAT_AUTO ,
"File format (10=automatic)" },
{ F|O, "GeoLabels" , opt_print_geo_labels , 1. ,
"Save labels in unrolled Gmsh geometries" },
{ F|O, "GifDither" , opt_print_gif_dither , 0. ,
"Apply dithering to GIF output" },
{ F|O, "GifInterlace" , opt_print_gif_interlace , 0. ,
"Interlace GIF output" },
{ F|O, "GifSort" , opt_print_gif_sort , 1. ,
"Sort the colormap in GIF output" },
{ F|O, "GifTransparent" , opt_print_gif_transparent , 0. ,
"Output transparent GIF image" },
{ F|O, "JpegQuality" , opt_print_jpeg_quality , 100. ,
"JPEG quality (between 1 and 100)" },
{ F|O, "JpegSmoothing" , opt_print_jpeg_smoothing , 0. ,
"JPEG smoothing (between 0 and 100)" },
{ F|O, "PostElementary" , opt_print_pos_elementary , 1. ,
"Save elementary region tags in mesh statistics exported as "
"post-processing views" },
{ F|O, "PostElement" , opt_print_pos_element , 0. ,
"Save element numbers in mesh statistics exported as post-processing views" },
{ F|O, "PostGamma" , opt_print_pos_gamma , 0. ,
"Save Gamma quality measure in mesh statistics exported as "
"post-processing views" },
{ F|O, "PostEta" , opt_print_pos_eta , 0. ,
"Save Eta quality measure in mesh statistics exported as "
"post-processing views" },
{ F|O, "PostRho" , opt_print_pos_rho , 0. ,
"Save Rho quality measure in mesh statistics exported as "
"post-processing views" },
{ F|O, "PostDisto" , opt_print_pos_disto , 0. ,
"Save Disto quality measure in mesh statistics exported as "
"post-processing views" },
{ F|O, "TexAsEquation" , opt_print_tex_as_equation , 0. ,
"Print all TeX strings as equations" },
{ F|O, "Text" , opt_print_text , 1. ,
"Print text strings?" },
{ 0, 0 , 0 , 0. }
} ;
// COLORS
// CONTRARY TO THE PRECEDING OPTIONS, THE ORDERING OF COLOR OPTIONS MATTERS !
// Solid Works (light blue to light gray): 94,198,255 -> 232,232,232
// Catia (dark grey-blue to light gray-blue): 63,62,119 -> 181,182,202
StringXColor GeneralOptions_Color[] = {
{ F|O, "Background" , opt_general_color_background ,
{0, 0, 0, 255}, {255, 255, 255, 255}, {255, 255, 255, 255},
"Background color" },
{ F|O, "BackgroundGradient" , opt_general_color_background_gradient ,
{0, 0, 128, 255}, {128, 147, 255, 255}, {125, 125, 125, 255},
"Background gradient color" },
{ F|O, "Foreground" , opt_general_color_foreground ,
{170, 170, 170, 255}, {85, 85, 85, 255}, {128, 128, 128, 255},
"Foreground color" },
{ F|O, "Text" , opt_general_color_text ,
{255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255},
"Text color" },
{ F|O, "Axes" , opt_general_color_axes ,
{255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255},
"Axes color" },
{ F|O, "SmallAxes" , opt_general_color_small_axes ,
{255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255},
"Small axes color" },
{ F|O, "AmbientLight" , opt_general_color_ambient_light,
{25, 25, 25, 255}, {25, 25, 25, 255}, {25, 25, 25, 255},
"Ambient light color" },
{ F|O, "DiffuseLight" , opt_general_color_diffuse_light,
{255, 255, 255, 255}, {255, 255, 255, 255}, {255, 255, 255, 255},
"Diffuse light color" },
{ F|O, "SpecularLight" , opt_general_color_specular_light,
{255, 255, 255, 255}, {255, 255, 255, 255}, {255, 255, 255, 255},
"Specular light color" },
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
StringXColor GeometryOptions_Color[] = {
{ F|O, "Points" , opt_geometry_color_points ,
{178, 182, 129, 255}, {90, 90, 90, 255}, {0, 0, 0, 255},
"Normal geometry point color" },
{ F|O, "Lines" , opt_geometry_color_lines ,
{0, 0, 255, 255}, {0, 0, 255, 255}, {0, 0, 0, 255},
"Normal geometry curve color" },
{ F|O, "Surfaces" , opt_geometry_color_surfaces ,
{128, 128, 128, 255}, {128, 128, 128, 255}, {0, 0, 0, 255},
"Normal geometry surface color" },
{ F|O, "Volumes" , opt_geometry_color_volumes ,
{255, 255, 0, 255}, {255, 255, 0, 255}, {0, 0, 0, 255},
"Normal geometry volume color" },
{ F|O, "Selection" , opt_geometry_color_selection ,
{255, 0, 0, 255}, {255, 0, 0, 255}, {255, 0, 0, 255},
"Selected geometry color" },
{ F|O, "HighlightZero" , opt_geometry_color_highlight0 ,
{255, 0, 0, 255}, {255, 0, 0, 255}, {255, 0, 0, 255},
"Highlight 0 color" },
{ F|O, "HighlightOne" , opt_geometry_color_highlight1 ,
{255, 150, 0, 255}, {255, 150, 0, 255}, {255, 150, 0, 255},
"Highlight 1 color" },
{ F|O, "HighlightTwo" , opt_geometry_color_highlight2 ,
{255, 255, 0, 255}, {255, 255, 0, 255}, {255, 255, 0, 255},
"Highlight 2 color" },
{ F|O, "Tangents" , opt_geometry_color_tangents ,
{255, 255, 0, 255}, {255, 255, 0, 255}, {0, 0, 0, 255},
"Tangent geometry vectors color" },
{ F|O, "Normals" , opt_geometry_color_normals ,
{255, 0, 0, 255}, {255, 0, 0, 255}, {0, 0, 0, 255},
"Normal geometry vectors color" },
{ F|O, "Projection" , opt_geometry_color_projection ,
{0, 255, 0, 255}, {0, 255, 0, 255}, {0, 0, 0, 255},
"Projection surface color" },
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
#define COLW {210, 210, 210, 255}
#define COLT {160, 150, 255, 255}
#define COLQ {130, 120, 225, 255}
#define COLP {232, 210, 23, 255}
#define COLY {217, 113, 38, 255}
#define COL0 {255, 120, 0, 255}
#define COL2 {255, 160, 0, 255}
#define COL4 {255, 200, 0, 255}
#define COL6 {255, 240, 0, 255}
#define COL8 {228, 255, 0, 255}
#define COL10 {188, 255, 0, 255}
#define COL12 {148, 255, 0, 255}
#define COL14 {108, 255, 0, 255}
#define COL16 {68, 255, 0, 255}
#define COL18 {0, 255, 52, 255}
#define COL1 {0, 255, 132, 255}
#define COL3 {0, 255, 192, 255}
#define COL5 {0, 216, 255, 255}
#define COL7 {0, 176, 255, 255}
#define COL9 {0, 116, 255, 255}
#define COL11 {0, 76, 255, 255}
#define COL13 {24, 0, 255, 255}
#define COL15 {84, 0, 255, 255}
#define COL17 {104, 0, 255, 255}
#define COL19 {184, 0, 255, 255}
StringXColor MeshOptions_Color[] = {
{ F|O, "Points" , opt_mesh_color_points ,
{0, 0, 255, 255}, {0, 0, 255, 255}, {0, 0, 0, 255},
"Mesh node color" },
{ F|O, "PointsSup" , opt_mesh_color_points_sup ,
{255, 0, 255, 255}, {255, 0, 255, 255}, {0, 0, 0, 255},
"Second order mesh node color" },
{ F|O, "Lines" , opt_mesh_color_lines ,
{0, 0, 0, 255}, {0, 0, 0, 255}, {0, 0, 0, 255},
"Mesh line color" },
{ F|O, "Triangles" , opt_mesh_color_triangles ,
COLT, COLT, COLW,
"Mesh triangle color (if Mesh.ColorCarousel=0)" },
{ F|O, "Quadrangles" , opt_mesh_color_quadrangles ,
COLQ, COLQ, COLW,
"Mesh quadrangle color (if Mesh.ColorCarousel=0)" },
{ F|O, "Tetrahedra" , opt_mesh_color_tetrahedra ,
COLT, COLT, COLW,
"Mesh tetrahedron color (if Mesh.ColorCarousel=0)" },
{ F|O, "Hexahedra" , opt_mesh_color_hexahedra ,
COLQ, COLQ, COLW,
"Mesh hexahedron color (if Mesh.ColorCarousel=0)" },
{ F|O, "Prisms" , opt_mesh_color_prisms ,
COLP, COLP, COLW,
"Mesh prism color (if Mesh.ColorCarousel=0)" },
{ F|O, "Pyramids" , opt_mesh_color_pyramid ,
COLY, COLY, COLW,
"Mesh pyramid color (if Mesh.ColorCarousel=0)" },
{ F|O, "Tangents" , opt_mesh_color_tangents ,
{255, 255, 0, 255}, {255, 255, 0, 255}, {0, 0, 0, 255},
"Tangent mesh vector color" },
{ F|O, "Normals" , opt_mesh_color_normals ,
{255, 0, 0, 255}, {255, 0, 0, 255}, {0, 0, 0, 255},
"Normal mesh vector color" },
{ F|O, "Zero" , opt_mesh_color_0 , COL0, COL0, COLW,
"Color 0 in color carousel" },
{ F|O, "One" , opt_mesh_color_1 , COL1, COL1, COLW,
"Color 1 in color carousel" },
{ F|O, "Two" , opt_mesh_color_2 , COL2, COL2, COLW,
"Color 2 in color carousel" },
{ F|O, "Three" , opt_mesh_color_3 , COL3, COL3, COLW,
"Color 3 in color carousel" },
{ F|O, "Four" , opt_mesh_color_4 , COL4, COL4, COLW,
"Color 4 in color carousel" },
{ F|O, "Five" , opt_mesh_color_5 , COL5, COL5, COLW,
"Color 5 in color carousel" },
{ F|O, "Six" , opt_mesh_color_6 , COL6, COL6, COLW,
"Color 6 in color carousel" },
{ F|O, "Seven" , opt_mesh_color_7 , COL7, COL7, COLW,
"Color 7 in color carousel" },
{ F|O, "Eight" , opt_mesh_color_8 , COL8, COL8, COLW,
"Color 8 in color carousel" },
{ F|O, "Nine" , opt_mesh_color_9 , COL9, COL9, COLW,
"Color 9 in color carousel" },
{ F|O, "Ten" , opt_mesh_color_10, COL10, COL10, COLW,
"Color 10 in color carousel" },
{ F|O, "Eleven" , opt_mesh_color_11, COL11, COL11, COLW,
"Color 11 in color carousel" },
{ F|O, "Twelve" , opt_mesh_color_12, COL12, COL12, COLW,
"Color 12 in color carousel" },
{ F|O, "Thirteen" , opt_mesh_color_13, COL13, COL13, COLW,
"Color 13 in color carousel" },
{ F|O, "Fourteen" , opt_mesh_color_14, COL14, COL14, COLW,
"Color 14 in color carousel" },
{ F|O, "Fifteen" , opt_mesh_color_15, COL15, COL15, COLW,
"Color 15 in color carousel" },
{ F|O, "Sixteen" , opt_mesh_color_16, COL16, COL16, COLW,
"Color 16 in color carousel" },
{ F|O, "Seventeen", opt_mesh_color_17, COL17, COL17, COLW,
"Color 17 in color carousel" },
{ F|O, "Eighteen" , opt_mesh_color_18, COL18, COL18, COLW,
"Color 18 in color carousel" },
{ F|O, "Nineteen" , opt_mesh_color_19, COL19, COL19, COLW,
"Color 19 in color carousel" },
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
StringXColor SolverOptions_Color[] = {
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
StringXColor PostProcessingOptions_Color[] = {
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
#define ELECOL {255, 255, 255, 255}, {0, 0, 0, 255}, {0, 0, 0, 255}
StringXColor ViewOptions_Color[] = {
{ F|O, "Points" , opt_view_color_points , ELECOL, "Point color" },
{ F|O, "Lines" , opt_view_color_lines , ELECOL, "Line color" },
{ F|O, "Triangles" , opt_view_color_triangles , ELECOL, "Triangle color" },
{ F|O, "Quadrangles" , opt_view_color_quadrangles , ELECOL, "Quadrangle color" },
{ F|O, "Tetrahedra" , opt_view_color_tetrahedra , ELECOL, "Tetrahedron color" },
{ F|O, "Hexahedra" , opt_view_color_hexahedra , ELECOL, "Hexahedron color" },
{ F|O, "Prisms" , opt_view_color_prisms , ELECOL, "Prism color" },
{ F|O, "Pyramids" , opt_view_color_pyramids , ELECOL, "Pyramid color" },
{ F|O, "Tangents" , opt_view_color_tangents ,
{255, 255, 0, 255}, {255, 255, 0, 255}, {0, 0, 0, 255},
"Tangent vector color" },
{ F|O, "Normals" , opt_view_color_normals ,
{255, 0, 0, 255}, {255, 0, 0, 255}, {0, 0, 0, 255},
"Normal vector color" },
{ F|O, "Text2D" , opt_view_color_text2d , ELECOL, "2D text color" },
{ F|O, "Text3D" , opt_view_color_text3d , ELECOL, "3D text color" },
{ F|O, "Axes" , opt_view_color_axes , ELECOL, "Axes color" },
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
StringXColor PrintOptions_Color[] = {
{ 0, 0 , 0 , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , 0 }
} ;
#undef S
#undef O
#undef F
#endif
// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <string>
#include <time.h>
#include "GmshConfig.h"
#include "GmshMessage.h"
#include "GmshDefines.h"
#include "GmshRemote.h"
#include "GModel.h"
#include "OpenFile.h"
#include "CreateFile.h"
#include "Options.h"
#include "CommandLine.h"
#include "OS.h"
#include "Context.h"
#include "ConnectionManager.h"
#include "robustPredicates.h"
#if defined(HAVE_MESH)
#include "Generator.h"
#include "Field.h"
#include "meshPartition.h"
#endif
#if defined(HAVE_PLUGINS)
#include "PluginManager.h"
#endif
#if defined(HAVE_FLTK)
#include "FlGui.h"
#include "menuWindow.h"
#include "drawContext.h"
#endif
int GmshInitialize(int argc, char **argv)
{
// we need at least one model during option parsing
GModel *dummy = 0;
if(GModel::list.empty()) dummy = new GModel();
// Initialize messages (parallel stuff, etc.)
Msg::Init(argc, argv);
// Load default options
InitOptions(0);
// Read configuration files and command line options
GetOptions(argc, argv);
// Make sure we have enough resources (stack)
CheckResources();
#if defined(HAVE_PLUGINS)
// Initialize the default plugins
PluginManager::instance()->registerDefaultPlugins();
#endif
// Initialize robust predicates
robustPredicates::exactinit();
if(dummy) delete dummy;
return 1;
}
int GmshSetMessageHandler(GmshMessage *callback)
{
Msg::SetCallback(callback);
return 1;
}
int GmshSetBoundingBox(double xmin, double xmax,
double ymin, double ymax,
double zmin, double zmax)
{
SetBoundingBox(xmin, xmax, ymin, ymax, zmin, zmax);
return 1;
}
int GmshSetOption(std::string category, std::string name, std::string value, int index)
{
return StringOption(GMSH_SET, category.c_str(), index, name.c_str(), value);
}
int GmshSetOption(std::string category, std::string name, double value, int index)
{
return NumberOption(GMSH_SET, category.c_str(), index, name.c_str(), value);
}
int GmshSetOption(std::string category, std::string name, unsigned int value, int index)
{
return ColorOption(GMSH_SET, category.c_str(), index, name.c_str(), value);
}
int GmshGetOption(std::string category, std::string name, std::string &value, int index)
{
return StringOption(GMSH_GET, category.c_str(), index, name.c_str(), value);
}
int GmshGetOption(std::string category, std::string name, double &value, int index)
{
return NumberOption(GMSH_GET, category.c_str(), index, name.c_str(), value);
}
int GmshGetOption(std::string category, std::string name, unsigned int &value, int index)
{
return ColorOption(GMSH_GET, category.c_str(), index, name.c_str(), value);
}
int GmshMergeFile(std::string fileName)
{
return MergeFile(fileName, true);
}
int GmshWriteFile(std::string fileName)
{
CreateOutputFile(fileName, FORMAT_AUTO);
return 1;
}
int GmshFinalize()
{
return 1;
}
int GmshBatch()
{
Msg::Info("Running '%s' [%d node(s), max. %d thread(s)]",
Msg::GetCommandLineArgs().c_str(),
Msg::GetCommSize(), Msg::GetMaxThreads());
Msg::Info("Started on %s", Msg::GetLaunchDate().c_str());
OpenProject(GModel::current()->getFileName());
for(unsigned int i = 1; i < CTX::instance()->files.size(); i++){
if(CTX::instance()->files[i] == "-new")
new GModel();
else
MergeFile(CTX::instance()->files[i]);
}
#if defined(HAVE_POST) && defined(HAVE_MESH)
if(!CTX::instance()->bgmFileName.empty()) {
MergeFile(CTX::instance()->bgmFileName);
if(PView::list.size())
GModel::current()->getFields()->setBackgroundMesh(PView::list.size() - 1);
else
Msg::Error("Invalid background mesh (no view)");
}
#endif
if(CTX::instance()->batch == -3){
GmshRemote();
}
else if(CTX::instance()->batch == -2){
GModel::current()->checkMeshCoherence(CTX::instance()->geom.tolerance);
}
else if(CTX::instance()->batch == -1){
CreateOutputFile(CTX::instance()->outputFileName,
CTX::instance()->outputFileName.empty() ? FORMAT_GEO :
FORMAT_AUTO);
}
else if(CTX::instance()->batch > 0){
#if defined(HAVE_MESH)
if(CTX::instance()->batch < 4)
GModel::current()->mesh(CTX::instance()->batch);
else if(CTX::instance()->batch == 4)
AdaptMesh(GModel::current());
else if(CTX::instance()->batch == 5)
RefineMesh(GModel::current(), CTX::instance()->mesh.secondOrderLinear);
#if defined(HAVE_CHACO) || defined(HAVE_METIS)
if(CTX::instance()->batchAfterMesh == 1){
if (CTX::instance()->partitionOptions.num_partitions > 1)
PartitionMesh(GModel::current(), CTX::instance()->partitionOptions);
if (CTX::instance()->partitionOptions.renumber)
RenumberMesh(GModel::current(), CTX::instance()->partitionOptions);
}
#endif
#endif
std::string name = CTX::instance()->outputFileName;
if(name.empty()){
if(CTX::instance()->mesh.fileFormat == FORMAT_AUTO)
name = GetDefaultFileName(FORMAT_MSH);
else
name = GetDefaultFileName(CTX::instance()->mesh.fileFormat);
}
CreateOutputFile(name, CTX::instance()->mesh.fileFormat);
}
time_t now;
time(&now);
std::string currtime = ctime(&now);
currtime.resize(currtime.size() - 1);
Msg::Info("Stopped on %s", currtime.c_str());
Msg::FinalizeClient();
return 1;
}
int GmshFLTK(int argc, char **argv)
{
#if defined(HAVE_FLTK) && defined(HAVE_POST)
// create the GUI
FlGui::instance(argc, argv);
// display GUI immediately for quick launch time
FlGui::instance()->check();
// open project file and merge all other input files
OpenProject(GModel::current()->getFileName());
for(unsigned int i = 1; i < CTX::instance()->files.size(); i++){
if(CTX::instance()->files[i] == "-new"){
GModel::current()->setVisibility(0);
new GModel();
}
else
MergeFile(CTX::instance()->files[i]);
}
if(CTX::instance()->post.combineTime){
PView::combine(true, 2, CTX::instance()->post.combineRemoveOrig);
FlGui::instance()->updateViews();
}
// init first context
switch (CTX::instance()->initialContext) {
case 1: FlGui::instance()->menu->setContext(menu_geometry, 0); break;
case 2: FlGui::instance()->menu->setContext(menu_mesh, 0); break;
case 3: FlGui::instance()->menu->setContext(menu_solver, 0); break;
case 4: FlGui::instance()->menu->setContext(menu_post, 0); break;
default: // automatic
if(PView::list.size())
FlGui::instance()->menu->setContext(menu_post, 0);
else
FlGui::instance()->menu->setContext(menu_geometry, 0);
break;
}
// read background mesh if any
if(!CTX::instance()->bgmFileName.empty()) {
MergeFile(CTX::instance()->bgmFileName);
if(PView::list.size())
GModel::current()->getFields()->setBackgroundMesh(PView::list.size() - 1);
else
Msg::Error("Invalid background mesh (no view)");
}
// listen to external solvers
if(CTX::instance()->solver.listen){
ConnectionManager::get(-1)->name = "unknown";
ConnectionManager::get(-1)->run("");
}
// loop
return FlGui::instance()->run();
#else
Msg::Error("GmshFLTK unavailable: please recompile with FLTK support");
return 0;
#endif
}