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 (16722)
---
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_.*$/
// $Id: Box.cpp,v 1.42 2008-01-20 11:20:58 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include <signal.h>
#include "GModel.h"
#include "Message.h"
#include "OS.h"
#include "Numeric.h"
#include "Generator.h"
#include "Parser.h"
#include "Context.h"
#include "Options.h"
#include "OpenFile.h"
#include "CommandLine.h"
#include "CreateFile.h"
#include "ParUtil.h"
#include "PluginManager.h"
#include "Field.h"
#include "BackgroundMesh.h"
Context_T CTX;
// Print some help/info messages
void Info(int level, char *arg0)
{
switch (level) {
case 0:
if(ParUtil::Instance()->master()) {
fprintf(stderr, "%s\n", gmsh_progname);
fprintf(stderr, "%s\n", gmsh_copyright);
Print_Usage(arg0);
}
ParUtil::Instance()->Exit();
case 1:
if(ParUtil::Instance()->master())
fprintf(stderr, "%s\n", Get_GmshVersion());
ParUtil::Instance()->Exit();
case 2:
if(ParUtil::Instance()->master()) {
fprintf(stderr, "%s%s\n", gmsh_version, Get_GmshVersion());
fprintf(stderr, "%s\n", gmsh_os);
fprintf(stderr, "%s\n", gmsh_date);
fprintf(stderr, "%s\n", gmsh_host);
fprintf(stderr, "%s\n", gmsh_packager);
fprintf(stderr, "%s\n", gmsh_url);
fprintf(stderr, "%s\n", gmsh_email);
}
ParUtil::Instance()->Exit();
default:
break;
}
}
// Main routine for the batch (black box) version
int GMSHBOX(int argc, char *argv[])
{
ParUtil::Instance()->init(argc, argv);
new GModel;
InitSymbols();
Init_Options(0);
if(argc < 2)
Info(0, argv[0]);
Get_Options(argc, argv);
// FIXME: could not make this work on IRIX
#if !defined(__sgi__)
signal(SIGINT, Signal);
signal(SIGSEGV, Signal);
signal(SIGFPE, Signal);
#endif
CheckResources();
GMSH_PluginManager::instance()->registerDefaultPlugins();
check_gsl();
OpenProject(CTX.filename);
if(gmsh_yyerrorstate)
ParUtil::Instance()->Abort();
else {
for(int i = 1; i < List_Nbr(CTX.files); i++)
MergeFile(*(char**)List_Pointer(CTX.files, i));
if(CTX.bgm_filename) {
MergeFile(CTX.bgm_filename);
if(PView::list.size()){
Field *field = new PostViewField(PView::list.back());
BGMAddField(field);
fields.insert(field);
}
else{
fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n");
exit(1);
}
}
if(CTX.batch > 0) {
GenerateMesh(CTX.batch);
CreateOutputFile(CTX.output_filename, CTX.mesh.format);
}
else if(CTX.batch == -1)
CreateOutputFile(CTX.output_filename, FORMAT_GEO);
ParUtil::Instance()->Barrier(__LINE__, __FILE__);
return 1;
}
ParUtil::Instance()->Barrier(__LINE__, __FILE__);
return 1;
}
// Handle signals. We should not use Msg functions in these...
void Signal(int sig_num)
{
switch (sig_num) {
case SIGSEGV:
Msg(FATAL, "Segmentation violation (invalid memory reference)");
break;
case SIGFPE:
Msg(FATAL, "Floating point exception (division by zero?)");
break;
case SIGINT:
Msg(FATAL, "Interrupt (generated from terminal special char)");
break;
default:
Msg(FATAL, "Unknown signal");
break;
}
}
// General purpose message routine
void Msg(int level, const char *fmt, ...)
{
va_list args;
int abort = 0;
va_start(args, fmt);
switch (level) {
case PROGRESS:
case STATUS1N:
case STATUS2N:
break;
case DIRECT:
if(CTX.verbosity >= 2 && ParUtil::Instance()->master()) {
vfprintf(stdout, fmt, args);
fprintf(stdout, "\n");
}
break;
case FATAL:
case FATAL3: abort = 1;
case FATAL1:
case FATAL2:
fprintf(stderr, FATAL_STR);
fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank());
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
break;
case GERROR:
case GERROR1:
case GERROR2:
case GERROR3:
fprintf(stderr, ERROR_STR);
fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank());
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
break;
case WARNING:
case WARNING1:
case WARNING2:
case WARNING3:
if(CTX.verbosity >= 1) {
fprintf(stderr, WARNING_STR);
fprintf(stderr, "[on processor %d] ", ParUtil::Instance()->rank());
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
case DEBUG:
case DEBUG1:
case DEBUG2:
case DEBUG3:
if(CTX.verbosity >= 4 && ParUtil::Instance()->master()) {
fprintf(stderr, DEBUG_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
default:
if(CTX.verbosity >= 2 && ParUtil::Instance()->master()) {
fprintf(stderr, INFO_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
}
va_end(args);
if(abort)
exit(1);
}
// interactive value dialog
double GetValue(const char *text, double defaultval)
{
if(CTX.nopopup)
return defaultval;
printf("%s (default=%.16g): ", text, defaultval);
char str[256];
fgets(str, sizeof(str), stdin);
if(!strlen(str) || !strcmp(str, "\n"))
return defaultval;
else
return atof(str);
}
bool GetBinaryAnswer(const char *question, const char *yes, const char *no,
bool defaultval)
{
if(CTX.nopopup || CTX.batch)
return defaultval;
char answ[256];
while(1){
printf("%s (%s/%s)",question,yes,no);
scanf("%s ",answ);
if (!strcmp(answ,yes))return true;
if (!strcmp(answ,no))return false;
}
}
extern int GMSHBOX(int argc, char *argv[]);
int main(int argc, char *argv[])
{
return GMSHBOX(argc, argv);
}
# $Id: Makefile,v 1.45 2008-02-07 21:29:38 geuzaine Exp $
#
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to <gmsh@geuz.org>.
include ../variables
LIB = ../lib/libGmshBox${LIBEXT}
INC = ${DASH}I../Common ${DASH}I../DataStr ${DASH}I../Geo ${DASH}I../Mesh\
${DASH}I../Post ${DASH}I../Graphics ${DASH}I../Numeric ${DASH}I../Parser\
${DASH}I../Fltk ${DASH}I../Plugin ${DASH}I../Parallel\
${DASH}I../contrib/ANN/include
CFLAGS = ${OPTIM} ${FLAGS} ${INC} ${SYSINCLUDE}
SRC = Box.cpp
OBJ = ${SRC:.cpp=${OBJEXT}}
.SUFFIXES: ${OBJEXT} .cpp
${LIB}: ${OBJ} Main${OBJEXT}
${AR} ${ARFLAGS}${LIB} ${OBJ}
${RANLIB} ${LIB}
.cpp${OBJEXT}:
${CXX} ${CFLAGS} ${DASH}c $<
clean:
rm -f *.o *.obj
depend:
(sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
${CXX} -MM ${CFLAGS} ${SRC} \
) >Makefile.new
cp Makefile Makefile.bak
cp Makefile.new Makefile
rm -f Makefile.new
# DO NOT DELETE THIS LINE
Box.o: Box.cpp ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \
../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \
../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \
../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \
../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/GFace.h ../Geo/GEntity.h \
../Geo/GPoint.h ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/SPoint2.h \
../Geo/SVector3.h ../Geo/Pair.h ../Geo/GRegion.h ../Geo/GEntity.h \
../Geo/SBoundingBox3d.h ../Common/Message.h ../Common/OS.h \
../Numeric/Numeric.h ../Numeric/NumericEmbedded.h ../Mesh/Generator.h \
../Parser/Parser.h ../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h \
../Common/Context.h ../Common/Options.h ../Post/ColorTable.h \
../Parser/OpenFile.h ../Common/CommandLine.h ../Parser/CreateFile.h \
../Parallel/ParUtil.h ../Plugin/PluginManager.h ../Plugin/Plugin.h \
../Post/PView.h ../Post/PViewData.h ../Post/PViewOptions.h \
../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
../Post/AdaptiveViews.h ../Common/GmshMatrix.h ../Mesh/Field.h \
../Geo/Geo.h ../Common/GmshDefines.h ../Geo/gmshSurface.h ../Geo/Pair.h \
../Geo/Range.h ../Geo/SPoint2.h ../Geo/SPoint3.h ../Geo/SVector3.h \
../Geo/SBoundingBox3d.h ../Geo/SPoint2.h ../Geo/ExtrudeParams.h \
../Common/SmoothData.h ../Post/OctreePost.h ../Common/Octree.h \
../Common/OctreeInternals.h ../Mesh/BackgroundMesh.h
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-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.
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()
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
endif()
project(gmsh CXX C)
# 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_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()
set(GMSH_DATE "${DATE}")
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)
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()
include(CheckTypeSize)
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 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()
set(GMSH_SRC ${GMSH_SRC};${LIST} PARENT_SCOPE)
set(GMSH_DIRS ${GMSH_DIRS};${DIRNAME} PARENT_SCOPE)
endmacro()
macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
set(${VARNAME})
list(LENGTH ${LISTNAME} NUM_LIST)
foreach(LIB ${${LISTNAME}})
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()
unset(FOUND_LIB CACHE)
endforeach()
list(LENGTH ${VARNAME} NUM_FOUND_LIBRARIES)
if(NUM_FOUND_LIBRARIES LESS NUM_LIST)
set(${VARNAME})
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[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[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()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/solver AND ENABLE_SOLVER)
add_subdirectory(src/solver)
set_config_option(HAVE_SOLVER "Solver")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/post AND ENABLE_POST)
add_subdirectory(src/post)
set_config_option(HAVE_POST "Post")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin AND ENABLE_PLUGINS)
add_subdirectory(src/plugin)
set_config_option(HAVE_PLUGINS "Plugins")
endif()
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/parser AND ENABLE_PARSER)
add_subdirectory(src/parser)
set_config_option(HAVE_PARSER "Parser")
endif()
if(ENABLE_VISUDEV)
set_config_option(HAVE_VISUDEV "VisuDev")
endif()
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 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})
execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --ldflags
OUTPUT_VARIABLE FLTK_LIBRARIES)
string(STRIP ${FLTK_LIBRARIES} FLTK_LIBRARIES)
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(src/fltk)
set_config_option(HAVE_FLTK "Fltk")
list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
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)
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)
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()
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)
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)
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_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(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/nglib)
set_config_option(HAVE_NETGEN "Netgen")
add_definitions(-DNO_PARALLEL_THREADS -DNOTCL)
endif()
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()
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_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 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})
list(APPEND EXTERNAL_INCLUDES ${MED_INC})
endif()
endif()
if(ENABLE_CGNS)
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})
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 NAMES szlib sz)
if(SZ_LIB)
list(APPEND EXTERNAL_LIBRARIES ${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()
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 "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)
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()
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)
# 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()
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
if(HAVE_SYS_SOCKET_H)
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
endif()
check_type_size(socklen_t 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()
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()
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)
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()
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()
if(ENV_CMAKE_INCLUDE_PATH)
string(REPLACE ":" ";" ENV_CMAKE_INCLUDE_PATH ${ENV_CMAKE_INCLUDE_PATH})
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()
if(EXTERNAL_INCLUDES)
list(REMOVE_DUPLICATES EXTERNAL_INCLUDES)
endif()
if(HAVE_FLTK)
set(LINK_LIBRARIES ${FLTK_LIBRARIES} ${EXTERNAL_LIBRARIES}
${OPENGL_LIBRARIES} ${LAPACK_LIBRARIES})
elseif(HAVE_OPENGL)
set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${OPENGL_LIBRARIES}
${LAPACK_LIBRARIES})
else()
set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
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(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" 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()
# 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)
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})
# OS specific linker options
if(WIN32 AND NOT MSVC)
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 /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
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}/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
COMMAND rm -f `find . -name *~ -o -name *~~`
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(etags
COMMAND etags `find . -name *.cpp -o -name *.h -o -name *.y`
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
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(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.tp ${TEX_DIR}/gmsh.tps ${TEX_DIR}/gmsh.txt ${TEX_DIR}/gmsh.vr)
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/${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()
if(WIN32)
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 "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 ../../..)
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)
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 ${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()
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}
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}
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 --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)
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 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()
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
${CMAKE_CURRENT_BINARY_DIR}/gmsh-${GMSH_VERSION}-doc.tgz
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 info txt html pdf
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(MAKEINFO OR TEXI2PDF)
add_custom_target(clean_doc COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ})
endif()
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}")
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/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/Headers/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
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
"3D finite element mesh generator with built-in CAD engine and post-processor")
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")
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" "/.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)
set(CPACK_INSTALL_COMMANDS "rm -rf ${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages")
endif()
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}/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}/src/fltk/MacIconsMsh.icns DESTINATION .
RENAME GmshMsh.icns)
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}/src/fltk/MacIcons.icns)
elseif(WIN32)
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_GENERATOR TGZ)
endif()
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()
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.
#ifndef _COLORS_H_
#define _COLORS_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#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 } ,
{ NULL , 0 , 0, 0, 255 }
} ;
int Get_ColorForString(StringX4Int SX4I[], int alpha,
char * string, int * FlagError);
#endif
// $Id: CommandLine.cpp,v 1.115 2008-02-05 18:58:04 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "GmshUI.h"
#include "GmshDefines.h"
#include "GmshVersion.h"
#include "Message.h"
#include "CommandLine.h"
#include "Numeric.h"
#include "Context.h"
#include "Options.h"
#include "PView.h"
#include "OpenFile.h"
#include "CreateFile.h"
#include "Parser.h"
#include "GModel.h"
#include "OS.h"
#if !defined(GMSH_EXTRA_VERSION)
#error
#error Common/GmshVersion.h is not up-to-date.
#error Please run 'make tag'.
#error
#endif
extern Context_T CTX;
char gmsh_progname[] = "Gmsh, a 3D mesh generator with pre- and post-processing facilities" ;
char gmsh_copyright[] = "Copyright (C) 1997-2007 Christophe Geuzaine and Jean-Francois Remacle";
char gmsh_version[] = "Version : " ;
char gmsh_license[] = "License : " GMSH_SHORT_LICENSE;
char gmsh_gui[] = "GUI toolkit : " ;
char gmsh_os[] = "Build OS : " GMSH_OS ;
char gmsh_options[] = "Build options : " ;
char gmsh_date[] = "Build date : " GMSH_DATE ;
char gmsh_host[] = "Build host : " GMSH_HOST ;
char gmsh_packager[] = "Packager : " GMSH_PACKAGER ;
char gmsh_url[] = "Web site : http://www.geuz.org/gmsh/" ;
char gmsh_email[] = "Mailing list : gmsh@geuz.org" ;
int Get_GmshMajorVersion(){ return GMSH_MAJOR_VERSION; }
int Get_GmshMinorVersion(){ return GMSH_MINOR_VERSION; }
int Get_GmshPatchVersion(){ return GMSH_PATCH_VERSION; }
char *Get_GmshExtraVersion(){ return GMSH_EXTRA_VERSION; }
char *Get_GmshVersion(){ return GMSH_VERSION; }
char *Get_GmshBuildDate(){ return GMSH_DATE; }
char *Get_GmshBuildHost(){ return GMSH_HOST; }
char *Get_GmshPackager(){ return GMSH_PACKAGER; }
char *Get_GmshBuildOS(){ return GMSH_OS; }
char *Get_GmshShortLicense(){ return GMSH_SHORT_LICENSE; }
void Print_Usage(char *name){
// If you make changes in this routine, please also change the
// texinfo documentation (doc/texinfo/command_line.texi) as well as
// 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, "Mesh options:");
Msg(DIRECT, " -1, -2, -3 Perform 1D, 2D or 3D mesh generation, then exit");
Msg(DIRECT, " -saveall Save all elements (discard physical group definitions)");
Msg(DIRECT, " -o file Specify mesh output file name");
Msg(DIRECT, " -format string Set output mesh format (msh, msh1, msh2, unv, vrml, stl, mesh,");
Msg(DIRECT, " bdf, p3d, cgns, med)");
Msg(DIRECT, " -bin Use binary format when available");
Msg(DIRECT, " -algo string Select mesh algorithm (iso, netgen, tetgen)");
Msg(DIRECT, " -smooth int Set number of mesh smoothing steps");
Msg(DIRECT, " -optimize Optimize quality of tetrahedral elements");
Msg(DIRECT, " -order int Set mesh order (1, ..., 5)");
Msg(DIRECT, " -optimize_hom Optimize higher order meshes (in 2D)");
Msg(DIRECT, " -clscale float Set characteristic length scaling factor");
Msg(DIRECT, " -clmin float Set minimum characteristic length");
Msg(DIRECT, " -clmax float Set maximum characteristic length");
Msg(DIRECT, " -clcurv Compute characteristic lengths from curvatures");
Msg(DIRECT, " -epslc1d Set the accuracy of the evaluation of the LCFIELD for 1D mesh");
Msg(DIRECT, " -swapangle Set the treshold angle (in degree) between two adjacent faces 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, " -constrain Constrain background mesh with characteristic lengths");
#if defined(HAVE_FLTK)
Msg(DIRECT, "Post-processing options:");
Msg(DIRECT, " -noview Hide all views on startup");
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, " -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, " -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");
}
char *Get_BuildOptions(void)
{
static int first=1;
static char opt[128] = "";
if(first){
#if defined(HAVE_GSL)
strcat(opt, "GSL ");
#endif
#if defined(HAVE_NETGEN)
strcat(opt, "NETGEN ");
#endif
#if defined(HAVE_TETGEN)
strcat(opt, "TETGEN ");
#endif
#if defined(HAVE_LIBJPEG)
strcat(opt, "JPEG ");
#endif
#if defined(HAVE_LIBPNG)
strcat(opt, "PNG ");
#endif
#if defined(HAVE_LIBZ)
strcat(opt, "ZLIB ");
#endif
#if defined(HAVE_MATH_EVAL)
strcat(opt, "MATHEVAL ");
#endif
#if defined(HAVE_METIS)
strcat(opt, "METIS ");
#endif
#if defined(HAVE_ANN)
strcat(opt, "ANN ");
#endif
#if defined(HAVE_CGNS)
strcat(opt, "CGNS ");
#endif
#if defined(HAVE_OCC)
strcat(opt, "OCC ");
#endif
#if defined(HAVE_MED)
strcat(opt, "MED ");
#endif
first = 0;
}
return opt;
}
void Get_Options(int argc, char *argv[])
{
// Parse session and option files
ParseFile(CTX.session_filename_fullpath, 1);
ParseFile(CTX.options_filename_fullpath, 1);
// Get command line options
int i = 1;
while(i < argc) {
if(argv[i][0] == '-') {
if(!strcmp(argv[i] + 1, "")) {
CTX.batch = -2;
i++;
}
else if(!strcmp(argv[i] + 1, "0")) {
CTX.batch = -1;
i++;
}
else if(!strcmp(argv[i] + 1, "1")) {
CTX.batch = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "2")) {
CTX.batch = 2;
i++;
}
else if(!strcmp(argv[i] + 1, "3")) {
CTX.batch = 3;
i++;
}
else if(!strcmp(argv[i] + 1, "4")) {
CTX.batch = 4;
i++;
}
else if(!strcmp(argv[i] + 1, "pid")) {
fprintf(stdout, "%d\n", GetProcessId());
fflush(stdout);
i++;
}
else if(!strcmp(argv[i] + 1, "a")) {
CTX.initial_context = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "g")) {
CTX.initial_context = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "m")) {
CTX.initial_context = 2;
i++;
}
else if(!strcmp(argv[i] + 1, "s")) {
CTX.initial_context = 3;
i++;
}
else if(!strcmp(argv[i] + 1, "p")) {
CTX.initial_context = 4;
i++;
}
else if(!strcmp(argv[i] + 1, "saveall")) {
CTX.mesh.save_all = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "optimize")) {
CTX.mesh.optimize = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "optimize_netgen")) {
CTX.mesh.optimize_netgen = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nopopup")) {
CTX.nopopup = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "string")) {
i++;
if(argv[i] != NULL)
ParseString(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing string\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "option")) {
i++;
if(argv[i] != NULL)
ParseFile(argv[i++], 1);
else {
fprintf(stderr, ERROR_STR "Missing file name\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "o")) {
i++;
if(argv[i] != NULL)
CTX.output_filename = argv[i++];
else {
fprintf(stderr, ERROR_STR "Missing file name\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "bgm")) {
i++;
if(argv[i] != NULL)
CTX.bgm_filename = argv[i++];
else {
fprintf(stderr, ERROR_STR "Missing file name\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "constrain")) {
CTX.mesh.constrained_bgmesh = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "convert")) {
i++;
CTX.terminal = 1;
CTX.batch = 1;
while(i < argc) {
char filename[256];
sprintf(filename, "%s_new", argv[i]);
unsigned int n = PView::list.size();
OpenProject(argv[i]);
// 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);
// convert mesh to latest binary format
if(GModel::current()->getMeshStatus() > 0){
CTX.mesh.msh_file_version = 2.0;
CTX.mesh.msh_binary = 1;
CreateOutputFile(filename, FORMAT_MSH);
}
i++;
}
exit(1);
}
else if(!strcmp(argv[i] + 1, "tol")) {
i++;
if(argv[i] != NULL)
CTX.geom.tolerance = atof(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "scale")) {
i++;
if(argv[i] != NULL)
CTX.geom.scaling_factor = atof(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "meshscale")) {
i++;
if(argv[i] != NULL)
CTX.mesh.scaling_factor = atof(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "rand")) {
i++;
if(argv[i] != NULL)
CTX.mesh.rand_factor = atof(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "clscale")) {
i++;
if(argv[i] != NULL) {
CTX.mesh.lc_factor = atof(argv[i++]);
if(CTX.mesh.lc_factor <= 0.0) {
fprintf(stderr, ERROR_STR
"Characteristic length factor must be > 0\n");
exit(1);
}
}
}
else if(!strcmp(argv[i] + 1, "clmin")) {
i++;
if(argv[i] != NULL) {
CTX.mesh.lc_min = atof(argv[i++]);
if(CTX.mesh.lc_min <= 0.0) {
fprintf(stderr, ERROR_STR
"Minimum length size must be > 0\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "clmax")) {
i++;
if(argv[i] != NULL) {
CTX.mesh.lc_max = atof(argv[i++]);
if(CTX.mesh.lc_max <= 0.0) {
fprintf(stderr, ERROR_STR
"Maximum length size must be > 0\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "epslc1d")) {
i++;
if(argv[i] != NULL) {
CTX.mesh.lc_integration_precision = atof(argv[i++]);
if(CTX.mesh.lc_integration_precision <= 0.0) {
fprintf(stderr, ERROR_STR
"Integration Accuraci for evaluation of 1D LC FIELD must be > 0\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "swapangle")) {
i++;
if(argv[i] != NULL) {
CTX.mesh.allow_swap_edge_angle = atof(argv[i++]);
if(CTX.mesh.allow_swap_edge_angle <= 0.0) {
fprintf(stderr, ERROR_STR
"Treshold angle for edge swap must be > 0\n");
exit(1);
}
}
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "clcurv")) {
CTX.mesh.lc_from_curvature = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "smooth")) {
i++;
if(argv[i] != NULL)
CTX.mesh.nb_smoothing = atoi(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "order") || !strcmp(argv[i] + 1, "degree")) {
i++;
if(argv[i] != NULL)
opt_mesh_order(0, GMSH_SET, atof(argv[i++]));
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "c1")) {
i++;
opt_mesh_c1(0, GMSH_SET, 1);
}
else if(!strcmp(argv[i] + 1, "statreport")) {
i++;
CTX.create_append_statreport = 1;
if(argv[i] != NULL) {
strcpy(CTX.statreport,argv[i]);
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing argument\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "append_statreport")) {
i++;
CTX.create_append_statreport = 2;
if(argv[i] != NULL) {
strcpy(CTX.statreport,argv[i]);
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing argument\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "optimize_hom")) {
i++;
opt_mesh_smooth_internal_edges(0, GMSH_SET, 1);
}
else if(!strcmp(argv[i] + 1, "format") || !strcmp(argv[i] + 1, "f")) {
i++;
if(argv[i] != NULL) {
if(!strcmp(argv[i], "msh1")){
CTX.mesh.format = FORMAT_MSH;
CTX.mesh.msh_file_version = 1.0;
}
else if(!strcmp(argv[i], "msh2")){
CTX.mesh.format = FORMAT_MSH;
CTX.mesh.msh_file_version = 2.0;
}
else if(!strcmp(argv[i], "msh"))
CTX.mesh.format = FORMAT_MSH;
else if(!strcmp(argv[i], "unv"))
CTX.mesh.format = FORMAT_UNV;
else if(!strcmp(argv[i], "vrml"))
CTX.mesh.format = FORMAT_VRML;
else if(!strcmp(argv[i], "stl"))
CTX.mesh.format = FORMAT_STL;
else if(!strcmp(argv[i], "mesh"))
CTX.mesh.format = FORMAT_MESH;
else if(!strcmp(argv[i], "bdf"))
CTX.mesh.format = FORMAT_BDF;
else if(!strcmp(argv[i], "p3d"))
CTX.mesh.format = FORMAT_P3D;
else if(!strcmp(argv[i], "cgns"))
CTX.mesh.format = FORMAT_CGNS;
else if(!strcmp(argv[i], "med"))
CTX.mesh.format = FORMAT_MED;
else {
fprintf(stderr, ERROR_STR "Unknown mesh format\n");
exit(1);
}
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing format\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "bin")) {
i++;
CTX.mesh.stl_binary = CTX.mesh.msh_binary = 1;
}
else if(!strcmp(argv[i] + 1, "algo")) {
i++;
if(argv[i] != NULL) {
if(!strncmp(argv[i], "del3d", 5) || !strncmp(argv[i], "tetgen", 6))
CTX.mesh.algo2d = ALGO_3D_TETGEN_DELAUNAY;
else if(!strncmp(argv[i], "netgen", 6))
CTX.mesh.algo3d = ALGO_3D_NETGEN;
else if(!strncmp(argv[i], "del2d", 5) || !strncmp(argv[i], "tri", 3))
CTX.mesh.algo2d = ALGO_2D_DELAUNAY;
else if(!strncmp(argv[i], "bds", 3))
CTX.mesh.algo2d = ALGO_2D_MESHADAPT;
else if(!strncmp(argv[i], "del", 3) || !strncmp(argv[i], "iso", 3))
CTX.mesh.algo2d = ALGO_2D_MESHADAPT_DELAUNAY;
else {
fprintf(stderr, ERROR_STR "Unknown mesh algorithm\n");
exit(1);
}
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing algorithm\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "listen")) {
CTX.solver.listen = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "version") || !strcmp(argv[i] + 1, "-version")) {
fprintf(stderr, "%s\n", GMSH_VERSION);
exit(1);
}
else if(!strcmp(argv[i] + 1, "info") || !strcmp(argv[i] + 1, "-info")) {
fprintf(stderr, "%s%s\n", gmsh_version, GMSH_VERSION);
#if defined(HAVE_FLTK)
fprintf(stderr, "%sFLTK %d.%d.%d\n", gmsh_gui, FL_MAJOR_VERSION,
FL_MINOR_VERSION, FL_PATCH_VERSION);
#else
fprintf(stderr, "%snone\n", gmsh_gui);
#endif
fprintf(stderr, "%s\n", gmsh_license);
fprintf(stderr, "%s\n", gmsh_os);
fprintf(stderr, "%s%s\n", gmsh_options, Get_BuildOptions());
fprintf(stderr, "%s\n", gmsh_date);
fprintf(stderr, "%s\n", gmsh_host);
fprintf(stderr, "%s\n", gmsh_packager);
fprintf(stderr, "%s\n", gmsh_url);
fprintf(stderr, "%s\n", gmsh_email);
exit(1);
}
else if(!strcmp(argv[i] + 1, "help") || !strcmp(argv[i] + 1, "-help")) {
fprintf(stderr, "%s\n", gmsh_progname);
fprintf(stderr, "%s\n", gmsh_copyright);
CTX.terminal = 1;
Print_Usage(argv[0]);
exit(1);
}
else if(!strcmp(argv[i] + 1, "v")) {
i++;
if(argv[i] != NULL)
CTX.verbosity = atoi(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
#if defined(HAVE_FLTK)
else if(!strcmp(argv[i] + 1, "term")) {
CTX.terminal = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "dual")) {
CTX.mesh.dual = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "noview")) {
opt_view_visible(0, GMSH_SET, 0);
i++;
}
else if(!strcmp(argv[i] + 1, "link")) {
i++;
if(argv[i] != NULL)
CTX.post.link = atoi(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "smoothview")) {
CTX.post.smooth = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "combine")) {
CTX.post.combine_time = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nodb")) {
CTX.db = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "fontsize")) {
i++;
if(argv[i] != NULL) {
CTX.fontsize = atoi(argv[i]);
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "theme") || !strcmp(argv[i] + 1, "scheme")) {
i++;
if(argv[i] != NULL) {
CTX.gui_theme = argv[i];
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing argument\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "display")) {
i++;
if(argv[i] != NULL) {
CTX.display = argv[i];
i++;
}
else {
fprintf(stderr, ERROR_STR "Missing argument\n");
exit(1);
}
}
#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 {
fprintf(stderr, "Unknown option '%s'\n", argv[i]);
CTX.terminal = 1;
Print_Usage(argv[0]);
exit(1);
}
}
else {
List_Add(CTX.files, &argv[i++]);
}
}
if(!List_Nbr(CTX.files))
strncpy(CTX.filename, CTX.default_filename_fullpath, 255);
else
strncpy(CTX.filename, *(char**)List_Pointer(CTX.files, 0), 255);
}
#ifndef _COMMAND_LINE_H_
#define _COMMAND_LINE_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
extern char gmsh_progname[], gmsh_copyright[], gmsh_version[], gmsh_os[];
extern char gmsh_date[], gmsh_host[], gmsh_packager[], gmsh_url[];
extern char gmsh_email[], gmsh_gui[], gmsh_options[], gmsh_license[];
void Get_Options(int argc, char *argv[]);
void Print_Usage(char *name);
char *Get_BuildOptions();
int Get_GmshMajorVersion();
int Get_GmshMinorVersion();
int Get_GmshPatchVersion();
char *Get_GmshExtraVersion();
char *Get_GmshVersion();
char *Get_GmshBuildDate();
char *Get_GmshBuildHost();
char *Get_GmshPackager();
char *Get_GmshBuildOS();
char *Get_GmshShortLicense();
#endif
// $Id: Context.cpp,v 1.60 2008-01-19 22:05:59 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "Numeric.h"
#include "Context.h"
#include "DefaultOptions.h"
#include "Trackball.h"
void Context_T::buildRotationMatrix(void)
{
if(useTrackball) {
build_rotmatrix(rot, quaternion);
setEulerAnglesFromRotationMatrix();
}
else {
double x = r[0] * Pi / 180.;
double y = r[1] * Pi / 180.;
double z = r[2] * Pi / 180.;
double A = cos(x);
double B = sin(x);
double C = cos(y);
double D = sin(y);
double E = cos(z);
double F = sin(z);
double AD = A * D;
double BD = B * D;
rot[0] = C*E; rot[1] = BD*E+A*F; rot[2] =-AD*E+B*F; rot[3] = 0.;
rot[4] =-C*F; rot[5] =-BD*F+A*E; rot[6] = AD*F+B*E; rot[7] = 0.;
rot[8] = D; rot[9] =-B*C; rot[10] = A*C; rot[11] = 0.;
rot[12] = 0.; rot[13] = 0.; rot[14] = 0.; rot[15] = 1.;
setQuaternionFromEulerAngles();
}
}
void Context_T::addQuaternion(double p1x, double p1y, double p2x, double p2y)
{
double quat[4];
trackball(quat, p1x, p1y, p2x, p2y);
add_quats(quat, quaternion, quaternion);
}
void Context_T::addQuaternionFromAxisAndAngle(double axis[3], double angle)
{
double a = angle * Pi / 180.;
double quat[4];
axis_to_quat(axis, a, quat);
add_quats(quat, quaternion, quaternion);
}
void Context_T::setQuaternion(double q0, double q1, double q2, double q3)
{
quaternion[0] = q0;
quaternion[1] = q1;
quaternion[2] = q2;
quaternion[3] = q3;
}
void Context_T::setQuaternionFromEulerAngles()
{
double x = r[0] * Pi / 180.;
double y = r[1] * Pi / 180.;
double z = r[2] * Pi / 180.;
double xx[3] = {1.,0.,0.};
double yy[3] = {0.,1.,0.};
double zz[3] = {0.,0.,1.};
double q1[4], q2[4], q3[4], tmp[4];
axis_to_quat(xx, -x, q1);
axis_to_quat(yy, -y, q2);
axis_to_quat(zz, -z, q3);
add_quats(q1, q2, tmp);
add_quats(tmp, q3, quaternion);
}
void Context_T::setEulerAnglesFromRotationMatrix()
{
r[1] = asin(rot[8]); // Calculate Y-axis angle
double C = cos(r[1]);
r[1] *= 180. / Pi;
if(fabs(C) > 0.005){ // Gimball lock?
double tmpx = rot[10] / C; // No, so get X-axis angle
double tmpy = -rot[9] / C;
r[0] = atan2(tmpy, tmpx) * 180. / Pi;
tmpx = rot[0] / C; // Get Z-axis angle
tmpy = -rot[4] / C;
r[2] = atan2(tmpy, tmpx) * 180. / Pi;
}
else{ // Gimball lock has occurred
r[0] = 0.; // Set X-axis angle to zero
double tmpx = rot[5]; // And calculate Z-axis angle
double tmpy = rot[1];
r[2] = atan2(tmpy, tmpx) * 180. / Pi;
}
// return only positive angles in [0,360]
if(r[0] < 0.) r[0] += 360.;
if(r[1] < 0.) r[1] += 360.;
if(r[2] < 0.) r[2] += 360.;
}
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "List.h"
// Interface-independent context
class Context_T {
public :
// general options
char filename[256]; // the name of the currently opened file
char no_ext_filename[256]; // the same without the extension
char base_filename[256]; // the base filename (no path, no extension)
char *bgm_filename; // background mesh
List_T *files; // all the files on the command line
char *output_filename; // output file specified with command line option '-o'
char *default_filename, default_filename_fullpath[256];
// the name of the default file
char *tmp_filename, tmp_filename_fullpath[256];
// the name of the temp file
char *session_filename, session_filename_fullpath[256];
// the name of the session configuration file
char *options_filename, options_filename_fullpath[256];
// the name of the option configuration file
char *error_filename, error_filename_fullpath[256];
// the name of the error file
// gmsh enables to output some mesh stats in a test suite file
// mesh algorithms are very sensitive to small parameter modifications
// and a test suite is indeed useful ;-)
char statreport[256];
int create_append_statreport; // do nothing 0 create 1 append 2
int session_save, options_save; // save session/option file on exit
int confirm_overwrite; // confirm overwrite when file->save as
char *display; // forced display host:0.0 under X11
int terminal; // show we print to the terminal console?
char *editor; // text editor command (with included '%s')
char *web_browser; // web browser command (with included '%s')
char home_dir[256]; // the home directory
char *gui_theme; // FLTK GUI theme
int tooltips; // show tootips in GUI?
int position[2]; // position of the menu window on the screen
int gl_position[2]; // position of the graphic window on the screen
int msg_position[2]; // position of the message window on the screen
int msg_size[2]; // size of the message window on the screen
int opt_position[2]; // position of the option window on the screen
int vis_position[2]; // position of the visibility window on the screen
int clip_position[2]; // position of the clipping planes window on the screen
int manip_position[2]; // position of the manipulator window on the screen
int stat_position[2]; // position of the statistics window on the screen
int ctx_position[2]; // position of the geo/mesh context windows on the screen
int solver_position[2]; // position of the solver windows on the screen
int plugin_position[2]; // position of the plugin window on the screen
int plugin_size[2]; // size of the plugin window on the screen
int file_chooser_position[2]; // position of the file chooser window on the screen
int system_menu_bar; // use the system menu bar on MacOS?
int batch; // 0=full gfx; -1=just parse; 1,2,3=batch 1D, 2D, 3D mesh
int initial_context; // 0=automatic; 1=geom; 2=mesh; 3=solver; 4=post
int verbosity; // 0=silent -> 3=debug
int nopopup; // never popup dialogs in scripts (use default values instead)
double rot[16]; // current rotation matrix
double r[3]; // current Euler angles (in degrees!)
double t[3], s[3]; // current translation and scale
double t_init[3]; // initial translation before applying modelview transform
double clip_factor; // clipping plane distance factor
double quaternion[4]; // current quaternion used for "trackball" rotation
int useTrackball; // do or do not use the trackball for rotations
double rotation_center[3]; // point around which to rotate the scene
int rotation_center_cg; // rotate around the center of mass instead of rotation_center[]
double min[3]; // x, y and z min for the current geometry
double max[3]; // x, y and z max for the current geometry
double cg[3]; // "center of mass" of the current geometry
double lc; // characteristic length for the whole problem (never
// used in mesh generation ->only for geo/post)
int db, antialiasing; // double buffer? antialiasing?
int ortho; // orthogonal projection?
int draw_bbox, draw_rotation_center; // draw the bounding boxes and the rot center?
int fast_redraw; // draw simplified model during user interaction
int small_axes, small_axes_size, small_axes_pos[2]; // small axes
int axes, axes_auto_position, axes_tics[3],axes_mikado; // large axes
double axes_position[6];
char axes_label[3][256], axes_format[3][256];
int threads, threads_lock; // threads?, lock (should be a mutex...)
int alpha; // enable alpha blending
double zoom_factor; // mouse2 zoom coefficient
int bg_gradient; // draw background gradient?
int fontsize; // font size for fltk UI
char *gl_font; // font for opengl graphics
int gl_font_enum; // font for opengl graphics (fltk enum value)
int gl_fontsize; // font size for opengl graphics
double point_size, line_width; // point/line widths
int viewport[4]; // current viewport
double vxmin, vxmax, vymin, vymax; // current viewport in real coordinates
int light[6]; // status of lights
double light_position[6][4]; // light sources positions
double shine, shine_exponent; // material specular reflection parameters
int render_mode; // GMSH_RENDER, GMSH_SELECT, GMSH_FEEDBACK
int clip[6]; // status of clip planes (bit arrays)
double clip_plane[6][4]; // clip planes
int polygon_offset, polygon_offset_always; // polygon offset control
double polygon_offset_factor, polygon_offset_units; // params for glPolygonOffset
double pixel_equiv_x, pixel_equiv_y ;
// approximative equivalent model length of a pixel
int color_scheme ; // general color scheme
int quadric_subdivisions; // nb of subdivisions for gluQuadrics (spheres/cylinders)
int vector_type; // default vector display type (for normals, etc.)
double arrow_rel_head_radius; // relative radius of arrow head
double arrow_rel_stem_radius; // relative radius of arrow stem
double arrow_rel_stem_length; // relative length of arrow stem
double model[16], proj[16]; // the modelview and projection matrix as they were
// at the time of the last InitPosition() call
double mesh_timer[3]; // records cpu times for 1-D, 2-D and 3-D mesh generation
int forced_bbox; // dynamic variable tracking if the bbox is currently imposed
int mouse_selection; // enable selection using the mouse
int mouse_hover_meshes; // enable mouse hover on meshes
int pick_elements; // allow individual element picking
int expert_mode; // to disable some warnings for beginners
int printing; // dynamic: equal to 1 while gmsh is printing
int hide_unselected; // hide all unselected entities
// geometry options
struct{
int points, lines, surfaces, volumes;
int points_num, lines_num, surfaces_num, volumes_num;
double point_size, line_width, point_sel_size, line_sel_width;
int point_type, line_type, surface_type;
int draw, light;
int old_circle, circle_points;
int extrude_spline_points, extrude_return_lateral, old_newreg;
double normals, tangents;
double scaling_factor;
int auto_coherence, highlight_orphans;
double tolerance;
double snap[3];
int occ_fix_small_edges, occ_fix_small_faces, occ_sew_faces;
} geom;
// mesh options
struct {
double msh_file_version;
int changed, draw;
int points, lines, triangles, quadrangles, tetrahedra, hexahedra, prisms, pyramids;
int surfaces_edges, surfaces_faces, volumes_edges, volumes_faces;
int points_num, lines_num, surfaces_num, volumes_num;
double label_frequency;
int point_type; // flat or 3D
double point_size, line_width;
int optimize, optimize_netgen, refine_steps;
int quality_type, label_type;
double quality_inf, quality_sup, radius_inf, radius_sup;
double scaling_factor, lc_factor, rand_factor, lc_integration_precision,lc_min,lc_max;
int dual, draw_skin_only;
int light, light_two_side, light_lines;
int format, nb_smoothing, algo2d, algo3d, algo_recombine;
int order, second_order_linear, second_order_incomplete;
int smooth_internal_edges, c1_continuity;
int min_circ_points, min_curv_points;
int constrained_bgmesh, lc_from_curvature;
double normals, tangents, explode;
int color_carousel;
int use_cut_plane, cut_plane_draw_intersect, cut_plane_only_volume;
double cut_planea, cut_planeb, cut_planec, cut_planed;
double evalCutPlane (double x, double y, double z){
double val = cut_planea * x + cut_planeb * y + cut_planec * z + cut_planed;
return val;
}
int save_all, save_groups_of_nodes, stl_binary, msh_binary, bdf_field_format;
char *triangle_options;
int smooth_normals, reverse_all_normals;
double angle_smooth_normals;
double allow_swap_edge_angle;
} mesh;
// post processing options
struct{
int draw, link, horizontal_scales ;
int smooth, anim_cycle, combine_time, combine_remove_orig ;
int file_format, plugins;
double anim_delay ;
void (*plugin_draw_function)(void) ;
}post;
// solver options
struct{
int max_delay, plugins, listen ;
char *socket_name ;
}solver;
// print options
struct{
int format;
int eps_quality, eps_background, eps_compress, eps_ps3shading;
int eps_occlusion_culling, eps_best_root;
double eps_line_width_factor, eps_point_size_factor;
int jpeg_quality, jpeg_smoothing;
int gif_dither, gif_sort, gif_interlace, gif_transparent;
int geo_labels;
int pos_elementary, pos_element, pos_gamma, pos_eta, pos_rho;
int text, tex_as_equation;
} print;
// color options
struct{
unsigned int bg, bg_grad, fg, text, axes, small_axes;
unsigned int ambient_light[6], diffuse_light[6], specular_light[6];
struct{
unsigned int point, line, surface, volume;
unsigned int selection, highlight[3], projection;
unsigned int tangents, normals;
} geom;
struct{
unsigned int vertex, vertex_sup, line, triangle, quadrangle;
unsigned int tetrahedron, hexahedron, prism, pyramid;
unsigned int carousel[20];
unsigned int tangents, normals;
} mesh;
} color;
// trackball functions
void buildRotationMatrix(void);
void setQuaternion(double p1x, double p1y, double p2x, double p2y);
void addQuaternion(double p1x, double p1y, double p2x, double p2y);
void addQuaternionFromAxisAndAngle(double axis[3], double angle);
void setQuaternionFromEulerAngles(void);
void setEulerAnglesFromRotationMatrix(void);
int big_endian; // is the machine big-endian?
// how RGBA values are packed and unpacked into/from an unsigned
// integer to be fed to glColor4ubv (depends on machine byte
// ordering!):
inline unsigned int PACK_COLOR(int R, int G, int B, int A){
if(big_endian) return ( (unsigned int)((R)<<24 | (G)<<16 | (B)<<8 | (A)) );
else return ( (unsigned int)((A)<<24 | (B)<<16 | (G)<<8 | (R)) );
}
inline int UNPACK_RED(unsigned int X){
if(big_endian) return ( ( (X) >> 24 ) & 0xff );
else return ( (X) & 0xff );
}
inline int UNPACK_GREEN(unsigned int X){
if(big_endian) return ( ( (X) >> 16 ) & 0xff );
else return ( ( (X) >> 8 ) & 0xff );
}
inline int UNPACK_BLUE(unsigned int X){
if(big_endian) return ( ( (X) >> 8 ) & 0xff );
else return ( ( (X) >> 16 ) & 0xff );
}
inline int UNPACK_ALPHA(unsigned int X){
if(big_endian) return ( (X) & 0xff );
else return ( ( (X) >> 24 ) & 0xff );
}
};
#endif
#ifndef _DEFAULT_OPTIONS_H_
#define _DEFAULT_OPTIONS_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#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, "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|S, "OptionsFileName" , opt_general_options_filename , ".gmsh-options" ,
"Option file created with `Tools->Options->Save'; automatically read on startup" },
{ 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 -e %s" ,
#else
"emacs %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
"firefox %s &" ,
#endif
"System command to launch a web browser" },
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString GeometryOptions_String[] = {
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString MeshOptions_String[] = {
{ F|O, "TriangleOptions" , opt_mesh_triangle_options , "praqzBPY" ,
"Options for Jonathan Shewchuk's Triangle isotropic algorithm" },
{ 0, NULL , NULL , NULL , NULL }
} ;
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 "pure" 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\nDiscrete Problems\n\n"
"Copyright (C) 1997-2007\nPatrick 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, "Extension0" , opt_solver_extension0 , ".pro" ,
"Default file name extension for solver 0" },
{ F|O, "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, "Extension1" , opt_solver_extension1 , "" ,
"Default file name extension for solver 1" },
{ F|O, "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, "Extension2" , opt_solver_extension2 , "" ,
"Default file name extension for solver 2" },
{ F|O, "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, "Extension3" , opt_solver_extension3 , "" ,
"Default file name extension for solver 3" },
{ F|O, "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, "Extension4" , opt_solver_extension4 , "" ,
"Default file name extension for solver 4" },
{ F|O, "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_command1, "%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, NULL , NULL , NULL , NULL }
} ;
StringXString PostProcessingOptions_String[] = {
{ 0, NULL , NULL , NULL , NULL }
} ;
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, NULL , NULL , NULL , NULL }
} ;
StringXString PrintOptions_String[] = {
{ 0, NULL , NULL , NULL , NULL }
} ;
// 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, "Clip0" , opt_general_clip0 , 0. ,
"Enable clipping plane 0 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ 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, "Clip1" , opt_general_clip1 , 0.,
"Enable clipping plane 1 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ F, "Clip1A" , opt_general_clip1a , 1.0 ,
"First coefficient in equation for clipping plane 1" },
{ F, "Clip1B" , opt_general_clip1b , 0.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, "Clip2" , opt_general_clip2 , 0.,
"Enable clipping plane 2 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ F, "Clip2A" , opt_general_clip2a , 1.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 , 0.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, "Clip3" , opt_general_clip3 , 0.,
"Enable clipping plane 3 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ 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 , 0.0 ,
"Fourth coefficient in equation for clipping plane 3" },
{ F, "Clip4" , opt_general_clip4 , 0.,
"Enable clipping plane 4 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ F, "Clip4A" , opt_general_clip4a , 1.0 ,
"First coefficient in equation for clipping plane 4" },
{ F, "Clip4B" , opt_general_clip4b , 0.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 , 0.0 ,
"Fourth coefficient in equation for clipping plane 4" },
{ F, "Clip5" , opt_general_clip5 , 0.,
"Enable clipping plane 5 (Geometry=2^0, Mesh=2^1, View[i]=2^(2+i))" },
{ F, "Clip5A" , opt_general_clip5a , 1.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 , 0.0 ,
"Third coefficient in equation for clipping plane 5" },
{ F, "Clip5D" , opt_general_clip5d , 0.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|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, "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, "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, "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|S, "GraphicsHeight" , opt_general_viewport3 , 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_viewport2 , 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|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 , 150. ,
"Vertical position (in pixels) of the upper left corner of the message window" },
{ F|S, "MessageHeight" , opt_general_message_size1 , 350. ,
"Height (in pixels) of the message window" },
{ F|S, "MessageWidth" , opt_general_message_size0 , 450. ,
"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|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, "PluginWidth" , opt_general_plugin_size0 , 100. ,
"Width (in pixels) of the plugin window" },
{ F|S, "PluginHeight" , opt_general_plugin_size1 , 100. ,
"Height (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 , 1.0 ,
"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, 8. ,
"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 of small axes (use negative values for right alignment)" },
{ F|O, "SmallAxesPositionY" , opt_general_small_axes_position1 , -40. ,
"Y position of small axes (use negative values for bottom alignment)" },
{ 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|S, "SystemMenuBar" , opt_general_system_menu_bar , 1. ,
"Use the system menu bar on Mac OS X?" },
{ F|O, "Terminal" , opt_general_terminal ,
#if defined(HAVE_FLTK)
0. ,
#else
1. ,
#endif
"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, "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 , 3. ,
"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, NULL , NULL , 0. , NULL }
} ;
StringXNumber GeometryOptions_Number[] = {
{ F|O, "AutoCoherence" , opt_geometry_auto_coherence , 1. ,
"Should all duplicate entities be automatically removed?" },
{ F|O, "CirclePoints" , opt_geometry_circle_points, 20. ,
"Number of points used to draw a circle/ellipse" },
{ 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, "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, "Normals" , opt_geometry_normals , 0. ,
"Display size of normal vectors (in pixels)" },
{ F|O, "OCCFixSmallEdges" , opt_geometry_occ_fix_small_edges , 1. ,
"Fix small edges in STEP, IGES and BRep models" },
{ F|O, "OCCFixSmallFaces" , opt_geometry_occ_fix_small_faces , 1. ,
"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, "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), 3D spheres (1) or scaled spheres (2)" },
{ 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 , 1. ,
"Display surfaces as wireframe (0) or solid (1)" },
{ 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|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, NULL , NULL , 0. , NULL }
} ;
StringXNumber MeshOptions_Number[] = {
{ F|O, "Algorithm" , opt_mesh_algo2d , ALGO_2D_MESHADAPT_DELAUNAY ,
"2D mesh algorithm (1=MeshAdapt+Delaunay, 4=MeshAdapt, 5=Delaunay)" },
{ F|O, "Algorithm3D" , opt_mesh_algo3d ,
#if defined(HAVE_TETGEN)
ALGO_3D_TETGEN_DELAUNAY ,
#else
ALGO_3D_NETGEN ,
#endif
"3D mesh algorithm (1=Tetgen+Delaunay, 4=Netgen)" },
{ F|O, "AngleSmoothNormals" , opt_mesh_angle_smooth_normals , 30.0 ,
"Threshold angle below which normals are not smoothed" },
{ F|O, "AllowSwapAngle" , opt_mesh_allow_swap_edge_angle , 10.0 ,
"Treshold 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, "CharacteristicLengthFactor" , opt_mesh_lc_factor , 1.0 ,
"Factor applied to all characteristic lengths" },
{ F|O, "CharacteristicLengthMin" , opt_mesh_lc_min, 0.0 ,
"Minimum mesh size" },
{ F|O, "CharacteristicLengthMax" , opt_mesh_lc_max, 1.e22 ,
"Maximum mesh size" },
{ F|O, "CharacteristicLengthFromCurvature" , opt_mesh_lc_from_curvature , 0. ,
"Compute characteritic lenghts automatically from curvatures" },
{ 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|O, "ConstrainedBackgroundMesh" , opt_mesh_constrained_bgmesh, 0. ,
"Should the background mesh be constrained by the characteristic lengths associated with the geometry?" },
{ F, "CpuTime" , opt_mesh_cpu_time , 0. ,
"CPU time (in seconds) for the generation of the current mesh (read-only)" },
{ F, "CutPlane" , opt_mesh_use_cut_plane , 0 ,
"Enable mesh cut plane" },
{ F, "CutPlaneDrawIntersect" , opt_mesh_cut_plane_draw_intersect , 0 ,
"Draw only the volume elements that intersect with the cut plane" },
{ F, "CutPlaneOnlyVolume" , opt_mesh_cut_plane_only_volume , 0 ,
"Cut only the volume elements" },
{ F, "CutPlaneA" , opt_mesh_cut_planea , 1.0 ,
"First cut plane equation coefficient (`A' in `AX+BY+CZ+D=0')" },
{ F, "CutPlaneB" , opt_mesh_cut_planeb , 0.0 ,
"Second cut plane equation coefficient (`B' in `AX+BY+CZ+D=0')" },
{ F, "CutPlaneC" , opt_mesh_cut_planec , 0.0 ,
"Third cut plane equation coefficient (`C' in `AX+BY+CZ+D=0')" },
{ F, "CutPlaneD" , opt_mesh_cut_planed , 0.0 ,
"Fourth cut plane equation coefficient (`D' in `AX+BY+CZ+D=0')" },
{ 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, "C1Continuity" , opt_mesh_c1 , 0. ,
"Impose C1 continuity to high order meshes, only valid in 2D plane and ElemenOrder = 2 and 3 (todo) (Default : C0 continuity)" },
{ F|O, "SmoothInternalEdges" , opt_mesh_smooth_internal_edges , 0 ,
"Number of smoothing steps of internal edges for high order meshes" },
{ F|O, "Explode" , opt_mesh_explode , 1.0 ,
"Element shrinking factor (between 0 and 1)" },
{ F|O, "Format" , opt_mesh_format , FORMAT_MSH ,
"Mesh output format (1=msh, 2=unv, 19=vrml, 27=stl, 30=mesh, 31=bdf, 32=cgns, 33=med)" },
{ F|O, "Hexahedra" , opt_mesh_hexahedra , 1. ,
"Display mesh hexahedra?" },
{ F|O, "LabelsFrequency" , opt_mesh_label_frequency , 100. ,
"Labels display frequency?" },
{ 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, "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 mesh elements (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, "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, "MshBinary" , opt_mesh_msh_binary , 0. ,
"Write MSH files in binary format?" },
{ F|O, "MshFileVersion" , opt_mesh_msh_file_version , 2.0 ,
"Version of the MSH file format to use" },
{ 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, "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, "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, "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 2D and 3D meshing algorithm (test other values when the algorithm fails)" },
{ F|O, "RefineSteps" , opt_mesh_refine_steps , 10 ,
"Number of refinement steps in the MeshAdapt-based 2D algorithms" },
{ F|O, "RecombineAlgo" , opt_mesh_recombine_algo , 1 ,
"Recombine algorithm (1=mixed triangles-quadrangles, 2=all quadrangles)" },
{ 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, "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, "SecondOrderIncomplete" , opt_mesh_second_order_incomplete , 1. ,
"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, "LcIntegrationPrecision" , opt_mesh_lc_integration_precision, 1.e-9 ,
"Accuracy of evaluation of the LC field for 1D mesh generation" },
{ F|O, "Smoothing" , opt_mesh_nb_smoothing , 1. ,
"Number of smoothing steps applied to the final mesh" },
{ F|O, "SmoothNormals" , opt_mesh_smooth_normals , 0. ,
"Smooth the mesh normals?" },
{ F|O, "StlBinary" , opt_mesh_stl_binary , 0. ,
"Save STL files in binary format?" },
{ 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, "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, "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?" },
{ 0, NULL , NULL , 0. , NULL }
} ;
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, "MaximumDelay" , opt_solver_max_delay , 4.0 ,
"Maximum delay (in seconds) allowed for solver response" },
{ 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 ,
#if defined(WIN32)
0. , // we already have the transient DOS window
#else
1. ,
#endif
"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" },
{ 0, NULL , NULL , 0. , NULL }
} ;
StringXNumber PostProcessingOptions_Number[] = {
{ F|O, "AnimationDelay" , opt_post_anim_delay , 0.25 ,
"Delay (in seconds) between frames in automatic animation mode" },
{ F|O, "AnimationCycle" , opt_post_anim_cycle , 0. ,
"Cycle through views instead of time steps in automatic animation mode" },
{ F|O, "CombineRemoveOriginal" , opt_post_combine_remove_orig , 1. ,
"Remove original views after a Combine operation" },
{ F|O, "Format" , opt_post_file_format , 0. ,
"Default file format for post-processing views (0=ASCII view, 1=binary view, 2=parsed view, 3=STL triangulation, 4=text, 5=mesh)" },
{ 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, NULL , NULL , 0. }
} ;
StringXNumber ViewOptions_Number[] = {
{ F|O, "AngleSmoothNormals" , opt_view_angle_smooth_normals , 30.0 ,
"Threshold angle below which normals are not smoothed" },
{ F|O, "ArrowHeadRadius" , opt_view_arrow_head_radius , 0.12 ,
"Relative radius of arrow head" },
{ F|O, "ArrowSize" , opt_view_arrow_size , 60. ,
"Display size of arrows (in pixels)" },
{ F|O, "ArrowSizeProportional" , opt_view_arrow_size_proportional , 1. ,
"Scale the arrows according to the norm of the vector" },
{ F|O, "ArrowStemLength" , opt_view_arrow_stem_length , 0.56 ,
"Relative length of arrow stem" },
{ F|O, "ArrowStemRadius" , opt_view_arrow_stem_radius , 0.02 ,
"Relative radius of arrow stem" },
{ 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.)" },
{ 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, "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, "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 view elements (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 , 15. ,
"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) or 3D spheres (1)" },
{ F|O, "PositionX" , opt_view_position0 , 100. ,
"Horizontal position (in pixels) of the upper left corner of the scale or 2D plot" },
{ F|O, "PositionY" , opt_view_position1 , 50. ,
"Vertical position (in pixels) of the upper left corner of the scale or 2D plot" },
{ 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, "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 , 1. ,
"Time display mode (0=hidden, 1=value if multi-step, 2=value always, 3=step if multi-step, 4=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, "Transform11" , opt_view_transform00 , 1. ,
"Element (1,1) of the 3x3 coordinate transformation matrix" },
{ F, "Transform12" , opt_view_transform01 , 0. ,
"Element (1,2) of the 3x3 coordinate transformation matrix" },
{ F, "Transform13" , opt_view_transform02 , 0. ,
"Element (1,3) of the 3x3 coordinate transformation matrix" },
{ F, "Transform21" , opt_view_transform10 , 0. ,
"Element (2,1) of the 3x3 coordinate transformation matrix" },
{ F, "Transform22" , opt_view_transform11 , 1. ,
"Element (2,2) of the 3x3 coordinate transformation matrix" },
{ F, "Transform23" , opt_view_transform12 , 0. ,
"Element (2,3) of the 3x3 coordinate transformation matrix" },
{ F, "Transform31" , opt_view_transform20 , 0. ,
"Element (3,1) of the 3x3 coordinate transformation matrix" },
{ F, "Transform32" , opt_view_transform21 , 0. ,
"Element (3,2) of the 3x3 coordinate transformation matrix" },
{ F, "Transform33" , 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)" },
{ 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, NULL , NULL , 0. , NULL }
} ;
StringXNumber PrintOptions_Number[] = {
{ 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 , 0.5 ,
"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_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, "TexAsEquation" , opt_print_tex_as_equation , 0. ,
"Print all TeX strings as equations" },
{ F|O, "Text" , opt_print_text , 1. ,
"Print text strings?" },
{ 0, NULL , NULL , 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, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
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, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
#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 COL1 {255, 160, 0, 255}
#define COL2 {255, 200, 0, 255}
#define COL3 {255, 240, 0, 255}
#define COL4 {228, 255, 0, 255}
#define COL5 {188, 255, 0, 255}
#define COL6 {148, 255, 0, 255}
#define COL7 {108, 255, 0, 255}
#define COL8 {68, 255, 0, 255}
#define COL9 {0, 255, 52, 255}
#define COL10 {0, 255, 132, 255}
#define COL11 {0, 255, 192, 255}
#define COL12 {0, 216, 255, 255}
#define COL13 {0, 176, 255, 255}
#define COL14 {0, 116, 255, 255}
#define COL15 {0, 76, 255, 255}
#define COL16 {24, 0, 255, 255}
#define COL17 {84, 0, 255, 255}
#define COL18 {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, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
StringXColor SolverOptions_Color[] = {
{ 0, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
StringXColor PostProcessingOptions_Color[] = {
{ 0, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
#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, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
StringXColor PrintOptions_Color[] = {
{ 0, NULL , NULL , {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} , NULL }
} ;
#undef S
#undef O
#undef F
#endif
#ifndef _GMSH_DEFINES_H_
#define _GMSH_DEFINES_H_
// IO file formats
#define FORMAT_MSH 1
#define FORMAT_UNV 2
#define FORMAT_GREF 3
#define FORMAT_XPM 4
#define FORMAT_PS 5
#define FORMAT_BMP 6
#define FORMAT_GIF 7
#define FORMAT_GEO 8
#define FORMAT_JPEG 9
#define FORMAT_AUTO 10
#define FORMAT_PPM 11
#define FORMAT_YUV 12
#define FORMAT_DMG 13
#define FORMAT_SMS 14
#define FORMAT_OPT 15
#define FORMAT_VTK 16
#define FORMAT_TEX 18
#define FORMAT_VRML 19
#define FORMAT_EPS 20
#define FORMAT_PNG 22
#define FORMAT_PDF 24
#define FORMAT_POS 26
#define FORMAT_STL 27
#define FORMAT_P3D 28
#define FORMAT_SVG 29
#define FORMAT_MESH 30
#define FORMAT_BDF 31
#define FORMAT_CGNS 32
#define FORMAT_MED 33
// Element types in .msh file format
#define MSH_LIN_2 1
#define MSH_TRI_3 2
#define MSH_QUA_4 3
#define MSH_TET_4 4
#define MSH_HEX_8 5
#define MSH_PRI_6 6
#define MSH_PYR_5 7
#define MSH_LIN_3 8
#define MSH_TRI_6 9
#define MSH_QUA_9 10
#define MSH_TET_10 11
#define MSH_HEX_27 12
#define MSH_PRI_18 13
#define MSH_PYR_14 14
#define MSH_PNT 15
#define MSH_QUA_8 16
#define MSH_HEX_20 17
#define MSH_PRI_15 18
#define MSH_PYR_13 19
#define MSH_TRI_9 20
#define MSH_TRI_10 21
#define MSH_TRI_12 22
#define MSH_TRI_15 23
#define MSH_TRI_15I 24
#define MSH_TRI_21 25
#define MSH_LIN_4 26
#define MSH_LIN_5 27
#define MSH_LIN_6 28
// Geometric entities
#define ENT_NONE 0
#define ENT_POINT (1<<0)
#define ENT_LINE (1<<1)
#define ENT_SURFACE (1<<2)
#define ENT_VOLUME (1<<3)
#define ENT_ALL (ENT_POINT | ENT_LINE | ENT_SURFACE | ENT_VOLUME)
// 2D mesh algorithms
#define ALGO_2D_MESHADAPT_DELAUNAY 1
#define ALGO_2D_ANISOTROPIC 2 // unused
#define ALGO_2D_TRIANGLE 3 // unused
#define ALGO_2D_MESHADAPT 4
#define ALGO_2D_DELAUNAY 5
// 3D mesh algorithms
#define ALGO_3D_TETGEN_DELAUNAY 1
#define ALGO_3D_NETGEN 4
#define ALGO_3D_TETGEN 5 // unused
#define TRANSFINI 1
#define LIBRE 2
#endif
#ifndef _GMSH_BOOSTMATRIX_
#define _GMSH_BOOSTMATRIX_
#include <assert.h>
template <class SCALAR>
class Gmsh_Vector
{
private:
int r;
public:
inline int size() const {return r;}
SCALAR *data;
~Gmsh_Vector() {delete [] data;}
Gmsh_Vector(int R)
: r(R)
{
data = new SCALAR [r];
scal(0);
}
Gmsh_Vector(const Gmsh_Vector<SCALAR> &other)
: r(other.r)
{
data = new double [r];
copy ( other.data ) ;
}
inline SCALAR operator () (int i) const
{
return data[i];
}
inline SCALAR & operator () (int i)
{
return data[i];
}
inline SCALAR operator *(const Gmsh_Vector<SCALAR> & other)
{
throw;
}
inline void scal ( const SCALAR s)
{
for (int i=0;i<r;++i)data[i]*=s;
}
inline void copy ( const SCALAR **other)
{
for (int i=0;i<r;++i)data[i]=other.data[i];
}
inline void lu_solve (const Gmsh_Vector<SCALAR>& rhs, Gmsh_Vector<SCALAR> & result)
{
throw;
}
};
template <class SCALAR>
class Gmsh_Matrix
{
private:
int r,c;
public:
inline int size1() const {return r;}
inline int size2() const {return c;}
SCALAR *data;
~Gmsh_Matrix() {delete [] data;}
Gmsh_Matrix(int R,int C)
: r(R),c(C)
{
data = new SCALAR [r*c];
scal(0);
}
Gmsh_Matrix(const Gmsh_Matrix<SCALAR> &other)
: r(other.r),c(other.c)
{
data = new double [r*c];
copy ( other.data ) ;
}
inline SCALAR operator () (int i, int j) const
{
return data[i+r*j];
}
inline SCALAR & operator () (int i, int j)
{
return data[i+r*j];
}
inline Gmsh_Matrix operator *(const Gmsh_Matrix<SCALAR> & other)
{
throw;
}
inline void scal ( const SCALAR s)
{
for (int i=0;i<r*c;++i)data[i]*=s;
}
inline void copy ( const SCALAR **other)
{
for (int i=0;i<r*c;++i)data[i]=other.data[i];
}
inline void mult(const Gmsh_Matrix<SCALAR> & x, const Gmsh_Matrix<SCALAR> & b)
{
throw;
}
inline void mult (const Gmsh_Vector<SCALAR> & x, Gmsh_Vector<SCALAR> & b )
{
throw;
}
inline void least_squares (const Gmsh_Vector<SCALAR> & rhs, Gmsh_Vector<SCALAR> & result)
{
throw;
}
inline void lu_solve (const Gmsh_Vector<SCALAR> & rhs, Gmsh_Vector<SCALAR> & result)
{
throw;
}
};
#ifdef HAVE_GSL
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_blas.h>
class GSL_Vector
{
private:
int r;
public:
inline int size() const {return r;}
gsl_vector *data;
~GSL_Vector() {gsl_vector_free (data);}
GSL_Vector(int R)
: r(R)
{
data = gsl_vector_calloc (r);
}
GSL_Vector(const GSL_Vector&other)
: r(other.r)
{
data = gsl_vector_calloc (r);
gsl_vector_memcpy (data, other.data);
}
inline double operator () (int i) const
{
return gsl_vector_get (data,i);
}
inline double & operator () (int i)
{
return *gsl_vector_ptr (data,i);
}
};
class GSL_Matrix
{
private:
int r,c;
public:
inline int size1() const {return r;}
inline int size2() const {return c;}
gsl_matrix *data;
~GSL_Matrix() {gsl_matrix_free (data);}
GSL_Matrix(int R,int C)
: r(R),c(C)
{
data = gsl_matrix_calloc (r, c);
}
GSL_Matrix(const GSL_Matrix&other)
: r(other.r),c(other.c)
{
data = gsl_matrix_calloc (r, c);
gsl_matrix_memcpy (data, other.data);
}
inline double operator () (int i, int j) const
{
return gsl_matrix_get (data,i,j);
}
inline double & operator () (int i, int j)
{
return *gsl_matrix_ptr (data,i,j);
}
inline void mult(const GSL_Matrix & x, const GSL_Matrix & b)
{
gsl_blas_dgemm (CblasNoTrans,CblasNoTrans, 1.0, data, x.data, 1.0, b.data);
}
inline void least_squares (const GSL_Vector & rhs, GSL_Vector & result)
{
assert (r > c);
assert (rhs.size() == r);
assert (result.size() == c);
GSL_Matrix *ls = new GSL_Matrix(c, c);
GSL_Vector *ls_rhs = new GSL_Vector(c);
//GSL_Vector *test = new GSL_Vector(c);
gsl_blas_dgemm (CblasTrans,CblasNoTrans, 1.0, data, data, 1.0, ls->data);
gsl_blas_dgemv (CblasTrans, 1.0, data, rhs.data, 1.0, ls_rhs->data);
ls->lu_solve (*ls_rhs,result);
delete ls;
delete ls_rhs;
}
inline void lu_solve (const GSL_Vector & rhs, GSL_Vector & result)
{
int s;
gsl_permutation * p = gsl_permutation_alloc (size1());
gsl_linalg_LU_decomp ( data, p, &s);
gsl_linalg_LU_solve ( data , p, rhs.data, result.data ) ;
gsl_permutation_free (p);
}
inline void mult (const GSL_Vector & x, GSL_Vector & b )
{
gsl_blas_dgemv (CblasNoTrans, 1.0, data, x.data, 1.0, b.data);
}
};
typedef GSL_Matrix Double_Matrix;
typedef GSL_Vector Double_Vector;
#else
typedef Gmsh_Matrix<double> Double_Matrix;
typedef Gmsh_Vector<double> Double_Vector;
#endif
typedef Gmsh_Matrix<int> Int_Matrix;
typedef Gmsh_Vector<int> Int_Vector;
#endif
#ifndef _GMSH_UI_H_
#define _GMSH_UI_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#if defined(HAVE_FLTK)
# include <FL/Fl.H>
# if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1)
# if (FL_PATCH_VERSION >= 6)
# define HAVE_FLTK_1_1_6_OR_ABOVE
# endif
# if (FL_PATCH_VERSION >= 5)
# define HAVE_FLTK_1_1_5_OR_ABOVE
# endif
# else
# error "Gmsh requires FLTK 1.1.x"
# endif
# include <FL/gl.h>
# if defined(__APPLE__)
# include <OpenGL/glu.h>
# else
# include <GL/glu.h>
# endif
# define GMSH_WINDOW_BOX FL_FLAT_BOX
#endif
// recent Cygwin releases define min/max macros!
#if defined(__CYGWIN__)
#undef min
#undef max
#endif
#endif