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 (19851)
---
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: Main.cpp,v 1.29 2003-03-21 00:52:34 geuzaine Exp $
//
// Copyright (C) 1997-2003 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 <sys/time.h>
#include <sys/resource.h>
#ifdef __APPLE__
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
#endif
#include "ParUtil.h"
#include "PluginManager.h"
#include "Gmsh.h"
#include "GmshVersion.h"
#include "Numeric.h"
#include "Geo.h"
#include "Mesh.h"
#include "Views.h"
#include "Parser.h"
#include "Context.h"
#include "Options.h"
#include "OpenFile.h"
#include "CommandLine.h"
#include "MinMax.h"
char yyname[256];
int yyerrorstate;
Context_T CTX;
Mesh M, *THEM = NULL, *LOCAL = NULL;
// 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, "%d.%d.%d\n", GMSH_MAJOR_VERSION, GMSH_MINOR_VERSION,
GMSH_PATCH_VERSION);
ParUtil::Instance()->Exit();
case 2:
if(ParUtil::Instance()->master()) {
fprintf(stderr, "%s%d.%d.%d\n", gmsh_version, GMSH_MAJOR_VERSION,
GMSH_MINOR_VERSION, GMSH_PATCH_VERSION);
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 main(int argc, char *argv[])
{
int i, nbf;
ParUtil::Instance()->init(argc, argv);
Init_Options(0);
if(argc < 2)
Info(0, argv[0]);
Get_Options(argc, argv, &nbf);
M.Vertices = NULL;
M.VertexEdges = NULL;
M.Simplexes = NULL;
M.Points = NULL;
M.Curves = NULL;
M.SurfaceLoops = NULL;
M.EdgeLoops = NULL;
M.Surfaces = NULL;
M.Volumes = NULL;
M.PhysicalGroups = NULL;
M.Metric = NULL;
signal(SIGINT, Signal);
signal(SIGSEGV, Signal);
signal(SIGFPE, Signal);
if(CTX.default_plugins)
GMSH_PluginManager::Instance()->RegisterDefaultPlugins();
check_gsl();
OpenProblem(CTX.filename);
if(yyerrorstate)
ParUtil::Instance()->Abort();
else {
for(i = 1; i < nbf; i++)
MergeProblem(TheFileNameTab[i]);
if(TheBgmFileName) {
MergeProblem(TheBgmFileName);
if(List_Nbr(CTX.post.list))
BGMWithView((Post_View *)
List_Pointer(CTX.post.list, List_Nbr(CTX.post.list) - 1));
else
fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n");
exit(1);
}
if(CTX.batch > 0) {
mai3d(THEM, CTX.batch);
Print_Mesh(THEM, CTX.output_filename, CTX.mesh.format);
}
else
Print_Geo(THEM, CTX.output_filename);
if(CTX.mesh.histogram)
Print_Histogram(THEM->Histogram[0]);
ParUtil::Instance()->Barrier(__LINE__, __FILE__);
ParUtil::Instance()->Exit();
return 1;
}
ParUtil::Instance()->Barrier(__LINE__, __FILE__);
ParUtil::Instance()->Exit();
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, char *fmt, ...)
{
va_list args;
int abort = 0;
va_start(args, fmt);
switch (level) {
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, "On processor %d : ", ParUtil::Instance()->rank());
fprintf(stderr, FATAL_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
break;
case GERROR:
case GERROR1:
case GERROR2:
case GERROR3:
fprintf(stderr, "On processor %d : ", ParUtil::Instance()->rank());
fprintf(stderr, ERROR_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
break;
case WARNING:
case WARNING1:
case WARNING2:
case WARNING3:
if(CTX.verbosity >= 1) {
fprintf(stderr, "On processor %d : ", ParUtil::Instance()->rank());
fprintf(stderr, WARNING_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
case DEBUG:
case DEBUG1:
case DEBUG2:
case DEBUG3:
if(CTX.verbosity >= 3 && ParUtil::Instance()->master()) {
fprintf(stderr, DEBUG_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
default:
if(CTX.verbosity >= 1 && ParUtil::Instance()->master()) {
fprintf(stderr, INFO_STR);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
}
break;
}
va_end(args);
if(abort)
exit(1);
}
// CPU time computation
void GetResources(long *s, long *us, long *mem)
{
static struct rusage r;
getrusage(RUSAGE_SELF, &r);
*s = (long)r.ru_utime.tv_sec;
*us = (long)r.ru_utime.tv_usec;
*mem = (long)r.ru_maxrss;
}
double Cpu(void)
{
long s, us, mem;
GetResources(&s, &us, &mem);
return (double)s + (double)us / 1.e6;
}
# $Id: Makefile,v 1.24 2003-03-21 00:52:34 geuzaine Exp $
#
# Copyright (C) 1997-2003 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.a
INCLUDE = -I../Common -I../DataStr -I../Geo -I../Graphics -I../Mesh -I../Numeric\
-I../Parser -I../Fltk -I../Plugin -I../Parallel
CFLAGS = ${OPTIM} ${FLAGS} ${INCLUDE}
SRC = Main.cpp
OBJ = ${SRC:.cpp=.o}
.SUFFIXES: .o .cpp
${LIB}: ${OBJ}
${AR} ${LIB} ${OBJ}
${RANLIB} ${LIB}
.cpp.o:
${CXX} ${CFLAGS} -c $<
clean:
rm -f *.o
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
Main.o: Main.cpp ../Parallel/ParUtil.h ../Plugin/PluginManager.h \
../Common/Gmsh.h ../Common/Message.h ../DataStr/Malloc.h \
../DataStr/List.h ../DataStr/Tree.h ../DataStr/avl.h ../DataStr/Tools.h \
../Common/GmshVersion.h ../Numeric/Numeric.h ../Geo/Geo.h \
../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \
../Geo/ExtrudeParams.h ../Mesh/STL.h ../Mesh/Metric.h ../Mesh/Matrix.h \
../Common/Views.h ../Common/ColorTable.h ../Parser/Parser.h \
../Common/Context.h ../Common/Options.h ../Parser/OpenFile.h \
../Common/CommandLine.h ../Geo/MinMax.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.
// $Id: ColorTable.cpp,v 1.17 2003-03-21 00:52:34 geuzaine Exp $
//
// Copyright (C) 1997-2003 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".
//
// Contributor(s):
// David Colignon
//
// These routines are loosely based on the colortable routines from
// the Vis5d program for visualizing five dimensional gridded data
// sets Copyright (C) 1990 - 1995 Bill Hibbard, Brian Paul, Dave
// Santek, and Andre Battaiola.
#include "Gmsh.h"
#include "ColorTable.h"
#include "Context.h"
extern Context_T CTX;
void ColorTable_InitParam(int number, GmshColorTable * ct,
int rgb_flag, int alpha_flag)
{
ct->ipar[COLORTABLE_NUMBER] = number;
if(rgb_flag) {
ct->ipar[COLORTABLE_INVERT] = 0;
ct->ipar[COLORTABLE_SWAP] = 0;
ct->ipar[COLORTABLE_ROTATE] = 0;
ct->fpar[COLORTABLE_CURVE] = 0.0;
ct->fpar[COLORTABLE_BIAS] = 0.0;
ct->fpar[COLORTABLE_BETA] = 0.0;
}
if(alpha_flag) {
ct->fpar[COLORTABLE_ALPHAPOW] = 1.;
ct->fpar[COLORTABLE_ALPHAVAL] = 255.;
}
}
void ColorTable_Recompute(GmshColorTable * ct, int rgb_flag, int alpha_flag)
{
float curve, bias;
double gamma;
int i, r, g, b, a, rotate;
float s, t;
ct->ipar[COLORTABLE_CHANGED] = 1;
bias = ct->fpar[COLORTABLE_BIAS];
curve = ct->fpar[COLORTABLE_CURVE];
rotate = ct->ipar[COLORTABLE_ROTATE];
for(i = 0; i < ct->size; i++) {
if(ct->size > 1) {
if(i + rotate < 0)
s = (float)(i + rotate + ct->size) / (float)(ct->size - 1);
else if(i + rotate > ct->size - 1)
s = (float)(i + rotate - ct->size) / (float)(ct->size - 1);
else
s = (float)(i + rotate) / (float)(ct->size - 1);
}
else
s = 0.;
if(ct->ipar[COLORTABLE_SWAP])
s = 1.0 - s;
if(rgb_flag) {
switch (ct->ipar[COLORTABLE_NUMBER]) {
case 1: // vis5d
t = (curve + 1.4) * (s - (1. + bias) / 2.);
r = (int)(128.0 + 127.0 * atan(7.0 * t) / 1.57);
g = (int)(128.0 + 127.0 * (2 * exp(-7 * t * t) - 1));
b = (int)(128.0 + 127.0 * atan(-7.0 * t) / 1.57);
break;
case 2: // samcef
if(s - bias <= 0.00) {
r = 0;
g = 0;
b = 255;
}
else if(s - bias <= 0.40) {
r = 0;
g = (int)((s - bias) * 637.5);
b = (int)(255. - (s - bias) * 637.5);
}
else if(s - bias <= 0.60) {
r = (int)(1275. * (s - bias - 0.4));
g = 255;
b = 0;
}
else if(s - bias <= 1.00) {
r = 255;
g = (int)(255. - 637.5 * (s - bias - 0.6));
b = 0;
}
else {
r = 255;
g = 0;
b = 0;
}
break;
case 3: // rainbow (matlab, etc.)
if(s - bias <= 0.00) {
r = 0;
g = 0;
b = 255;
}
else if(s - bias <= 0.25 + curve) {
curve = (curve == -0.25) ? -0.26 : curve;
r = 0;
g = (int)((s - bias) * (255. / (0.25 + curve)));
b = 255;
}
else if(s - bias <= 0.50) {
curve = (curve == 0.25) ? 0.26 : curve;
r = 0;
g = 255;
b =
(int)(255. - (255. / (0.25 - curve)) * (s - bias - 0.25 - curve));
}
else if(s - bias <= 0.75 - curve) {
curve = (curve == 0.25) ? 0.26 : curve;
r = (int)((s - bias - 0.5) * (255. / (0.25 - curve)));
g = 255;
b = 0;
}
else if(s - bias <= 1.00) {
curve = (curve == -0.25) ? -0.26 : curve;
r = 255;
g =
(int)(255. - (255. / (0.25 + curve)) * (s - bias - 0.75 + curve));
b = 0;
}
else {
r = 255;
g = 0;
b = 0;
}
break;
case 4: // darkblue-red-yellow-white
#define myfct(a,b,c,d) ((a)+\
(b)*(s-bias)+\
(c)*(s-bias)*(s-bias)+\
(d)*(s-bias)*(s-bias)*(s-bias))
#define clamp(x) x = (x)<0?0:((x)>255?255:(x))
r = (int)(255. * myfct(-0.0506169, 2.81633, -1.87033, 0.0524573));
g = (int)(255. * myfct(0.0485868, -1.26109, 6.3074, -4.12498));
b = (int)(255. * myfct(0.364662, 1.50814, -7.36756, 6.51847));
clamp(r);
clamp(g);
clamp(b);
#undef myfct
#undef clamp
break;
case 5: // grayscale
if(s - bias <= 0.00) {
r = g = b = 0;
}
else if(s - bias <= 1.00) {
r = g = b = (int)(255 * (s - bias));
}
else {
r = g = b = 255;
}
break;
case 6: // monochrome
r = g = b = 0;
break;
case 7: // rainbow modified to add black and white , from EMC2000
if(s - bias <= 0.00) {
r = 0;
g = 0;
b = 0;
}
else if(s - bias <= 0.2) {
r = (int)(57 * (1 - 100 * ((s - bias) - 0.1) * ((s - bias) - 0.1)));
g = 0;
b = (int)((s - bias) * (255. / 0.2));
}
else if(s - bias <= 0.3624) {
r = 0;
g = (int)((s - bias - 0.2) * (255. / 0.1624));
b = 255;
}
else if(s - bias <= 0.50) {
r = 0;
g = 255;
b = (int)(255. - (255. / 0.1376) * (s - bias - 0.3624));
}
else if(s - bias <= 0.6376) {
r = (int)((s - bias - 0.5) * (255. / 0.1376));
g = 255;
b = 0;
}
else if(s - bias <= 0.8) {
r = 255;
g = (int)(255. - (255. / 0.1624) * (s - bias - 0.6376));
b = 0;
}
else if(s - bias <= 1.0) {
r = 255;
g = (int)((255. / 0.2) * (s - bias - 0.8));
b =
(int)(-3187.66 * (s - bias) * (s - bias) + 7012.76 * (s - bias) -
3570.61);
}
else {
r = 255;
g = 255;
b = 255;
}
break;
case 8: // grayscale, without white
default:
if(s - bias <= 0.00) {
r = g = b = 0;
}
else if(s - bias <= 1.00) {
r = g = b = (int)(220 * (s - bias));
}
else {
r = g = b = 220;
}
break;
}
if(ct->fpar[COLORTABLE_BETA]) {
if(ct->fpar[COLORTABLE_BETA] > 0.0)
gamma = 1. - ct->fpar[COLORTABLE_BETA];
else
gamma = 1. / (1.001 + ct->fpar[COLORTABLE_BETA]); // beta is thresholded to [-1,1]
r = (int)(255. * pow((double)r / 255., gamma));
g = (int)(255. * pow((double)g / 255., gamma));
b = (int)(255. * pow((double)b / 255., gamma));
}
if(ct->ipar[COLORTABLE_INVERT]) {
r = 255 - r;
g = 255 - g;
b = 255 - b;
}
}
else {
r = UNPACK_RED(ct->table[i]);
g = UNPACK_GREEN(ct->table[i]);
b = UNPACK_BLUE(ct->table[i]);
}
if(alpha_flag) {
a = (int)(ct->fpar[COLORTABLE_ALPHAVAL] *
ct->fpar[COLORTABLE_ALPHAPOW]);
}
else {
a = UNPACK_ALPHA(ct->table[i]);
}
ct->table[i] = PACK_COLOR(r, g, b, a);
}
}
static GmshColorTable clip;
void ColorTable_Copy(GmshColorTable * ct)
{
clip.size = ct->size;
memcpy(clip.table, ct->table, ct->size * sizeof(unsigned int));
memcpy(clip.ipar, ct->ipar, COLORTABLE_NBMAX_PARAM * sizeof(int));
memcpy(clip.fpar, ct->fpar, COLORTABLE_NBMAX_PARAM * sizeof(float));
}
void ColorTable_Paste(GmshColorTable * ct)
{
ct->size = clip.size;
memcpy(ct->table, clip.table, clip.size * sizeof(unsigned int));
memcpy(ct->ipar, clip.ipar, COLORTABLE_NBMAX_PARAM * sizeof(int));
memcpy(ct->fpar, clip.fpar, COLORTABLE_NBMAX_PARAM * sizeof(float));
}
void ColorTable_Print(GmshColorTable * ct, FILE * fp)
{
int i, r, g, b, a;
char tmp1[1024], tmp2[1024];
strcpy(tmp1, "");
for(i = 0; i < ct->size; i++) {
r = UNPACK_RED(ct->table[i]);
g = UNPACK_GREEN(ct->table[i]);
b = UNPACK_BLUE(ct->table[i]);
a = UNPACK_ALPHA(ct->table[i]);
if(i && !(i % 4)) {
if(fp)
fprintf(fp, "%s\n", tmp1);
else
Msg(DIRECT, tmp1);
strcpy(tmp1, "");
}
sprintf(tmp2, "{%d, %d, %d, %d}", r, g, b, a);
strcat(tmp1, tmp2);
if(i != ct->size - 1)
strcat(tmp1, ", ");
}
if(fp)
fprintf(fp, "%s\n", tmp1);
else
Msg(DIRECT, tmp1);
}
int ColorTable_IsAlpha(GmshColorTable * ct)
{
int i, a;
for(i = 0; i < ct->size; i++) {
a = UNPACK_ALPHA(ct->table[i]);
if(a < 255)
return 1;
}
return 0;
}
#ifndef _COLORTABLE_H_
#define _COLORTABLE_H_
// Copyright (C) 1997-2003 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".
#define COLORTABLE_NBMAX_PARAM 10
#define COLORTABLE_NBMAX_COLOR 255
typedef struct{
unsigned int table[COLORTABLE_NBMAX_COLOR];
int size; // must be >= 2
int ipar[COLORTABLE_NBMAX_PARAM];
float fpar[COLORTABLE_NBMAX_PARAM];
}GmshColorTable;
// COLORTABLE_MODE
#define COLORTABLE_RGB 1
#define COLORTABLE_HSV 2
// integrer parameters indices
#define COLORTABLE_NUMBER 0 // predefined curve index
#define COLORTABLE_CHANGED 1 // did the colortable change ?
#define COLORTABLE_INVERT 2 // invert (rbg<->255-rgb)
#define COLORTABLE_SWAP 3 // swap (min<->max)
#define COLORTABLE_ROTATE 4 // rotate
#define COLORTABLE_MODE 5 // mode (rgb, hsv)
// float parameters indices
#define COLORTABLE_CURVE 0 // curvature
#define COLORTABLE_BIAS 1 // offset
#define COLORTABLE_ALPHAPOW 2 // alpha channel power
#define COLORTABLE_ALPHAVAL 3 // alpha channel value
#define COLORTABLE_BETA 4 // beta coeff for brighten
void ColorTable_InitParam (int number, GmshColorTable * ct, int rgb_flag, int alpha_flag);
void ColorTable_Recompute (GmshColorTable * ct, int rgb_flag, int alpha_flag);
void ColorTable_Copy(GmshColorTable *ct);
void ColorTable_Paste(GmshColorTable *ct);
void ColorTable_Print(GmshColorTable *ct, FILE *fp) ;
int ColorTable_IsAlpha(GmshColorTable *ct) ;
#endif
#ifndef _COLORS_H_
#define _COLORS_H_
// Copyright (C) 1997-2003 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.16 2003-03-21 00:52:34 geuzaine Exp $
//
// Copyright (C) 1997-2003 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 <unistd.h>
#include "Gmsh.h"
#include "GmshUI.h"
#include "GmshVersion.h"
#include "CommandLine.h"
#include "Numeric.h"
#include "Context.h"
#include "Options.h"
#include "Geo.h"
#include "Mesh.h"
#include "Views.h"
#include "OpenFile.h"
#include "Parser.h"
#if !defined(GMSH_MAJOR_VERSION)
#error
#error Common/GmshVersion.h is not up-to-date.
#error Please run 'make tag'.
#error
#endif
extern Context_T CTX;
char *TheFileNameTab[MAX_OPEN_FILES];
char *TheBgmFileName = NULL, *TheOptString = NULL;
// *INDENT-OFF*
char gmsh_progname[] = "This is Gmsh" ;
char gmsh_copyright[] = "Copyright (C) 1997-2003 Jean-Francois Remacle and Christophe Geuzaine";
char gmsh_version[] = "Version : " ;
char gmsh_license[] = "License : GNU General Public 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" ;
void Print_Usage(char *name){
Msg(DIRECT, "Usage: %s [options] [files]", name);
Msg(DIRECT, "Geometry options:");
Msg(DIRECT, " -0 parse input files, output unrolled geometry, and exit");
Msg(DIRECT, "Mesh options:");
Msg(DIRECT, " -1, -2, -3 perform batch 1D, 2D and 3D mesh generation");
Msg(DIRECT, " -saveall save all elements (discard physical group definitions)");
Msg(DIRECT, " -o file specify mesh output file name");
Msg(DIRECT, " -format msh|unv|gref set output mesh format (default: msh)");
Msg(DIRECT, " -algo iso|tri|aniso select 2D mesh algorithm (default: iso)");
Msg(DIRECT, " -smooth int set mesh smoothing (default: 0)");
// Msg(DIRECT, " -degree int set mesh degree (default: 1)");
Msg(DIRECT, " -scale float set global scaling factor (default: 1.0)");
Msg(DIRECT, " -meshscale float set mesh scaling factor (default: 1.0)");
Msg(DIRECT, " -clscale float set characteristic length scaling factor (default: 1.0)");
Msg(DIRECT, " -rand float set random perturbation factor (default: 1.e-4)");
Msg(DIRECT, " -bgm file load backround mesh from file");
Msg(DIRECT, " -constrain constrain background mesh with characteristic lengths");
Msg(DIRECT, " -histogram print mesh quality histogram");
Msg(DIRECT, " -extrude use old extrusion mesh generator");
Msg(DIRECT, " -recombine recombine meshes from old extrusion mesh generator");
#if defined(HAVE_FLTK)
Msg(DIRECT, " -interactive display 2D mesh construction interactively");
Msg(DIRECT, "Post-processing options:");
Msg(DIRECT, " -dl enable display lists");
Msg(DIRECT, " -noview hide all views on startup");
Msg(DIRECT, " -link int select link mode between views (default: 0)");
Msg(DIRECT, " -smoothview smooth views");
Msg(DIRECT, " -convert file file convert an ascii view into a binary one");
Msg(DIRECT, "Display options:");
Msg(DIRECT, " -nodb disable double buffering");
Msg(DIRECT, " -fontsize int specify the font size for the GUI (default: 12)");
Msg(DIRECT, " -theme string specify GUI theme");
Msg(DIRECT, " -alpha enable alpha blending");
Msg(DIRECT, " -notrack don't use trackball mode for rotations");
Msg(DIRECT, " -display string specify display");
Msg(DIRECT, " -perspective set projection mode to perspective");
#endif
Msg(DIRECT, "Other options:");
#if defined(HAVE_FLTK)
Msg(DIRECT, " -a, -g, -m, -s, -p start in automatic, geometry, mesh, solver or");
Msg(DIRECT, " post-processing mode (default: automatic)");
#endif
Msg(DIRECT, " -v int set verbosity level (default: 2)");
Msg(DIRECT, " -string \"string\" parse string before project file");
Msg(DIRECT, " -option file parse option file before GUI creation");
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, "HAVE_GSL ");
#endif
#if defined(HAVE_TRIANGLE)
strcat(opt, "HAVE_TRIANGLE ");
#endif
#if defined(HAVE_LIBJPEG)
strcat(opt, "HAVE_LIBJPEG ");
#endif
first = 0;
}
return opt;
}
// *INDENT-ON*
void Get_Options(int argc, char *argv[], int *nbfiles)
{
int i = 1;
// This symbol context is local to option parsing (the symbols will
// not interfere with subsequent OpenFiles)
InitSymbols();
// Parse session and option files
ParseFile(CTX.sessionrc_filename, 1);
ParseFile(CTX.optionsrc_filename, 1);
// Get command line options
TheFileNameTab[0] = CTX.default_filename;
*nbfiles = 0;
while(i < argc) {
if(argv[i][0] == '-') {
if(!strcmp(argv[i] + 1, "string")) {
i++;
if(argv[i] != NULL)
TheOptString = argv[i++];
else {
fprintf(stderr, ERROR_STR "Missing string\n");
exit(1);
}
}
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, "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, "saveall")) {
CTX.mesh.save_all = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "extrude")) { //old extrusion mesh generator
CTX.mesh.oldxtrude = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "recombine")) { //old extrusion mesh generator
CTX.mesh.oldxtrude_recombine = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "dupli")) {
CTX.mesh.check_duplicates = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "histogram")) {
CTX.mesh.histogram = 1;
i++;
}
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)
TheBgmFileName = 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;
if(argv[i] && argv[i + 1]) {
ParseFile(argv[i], 0);
if(List_Nbr(CTX.post.list))
WriteView(1, (Post_View *) List_Pointer(CTX.post.list, 0),
argv[i + 1]);
else
fprintf(stderr, ERROR_STR "No view to convert\n");
}
else
fprintf(stderr, "Usage: %s -convert view.ascii view.binary\n",
argv[0]);
exit(1);
}
else if(!strcmp(argv[i] + 1, "old")) {
CTX.geom.old_circle = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "initial")) {
i++;
if(argv[i] != NULL)
CTX.mesh.initial_only = atoi(argv[i++]);
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "quality")) {
i++;
if(argv[i] != NULL)
CTX.mesh.quality = 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 {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
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, "degree")) {
i++;
if(argv[i] != NULL)
opt_mesh_degree(0, GMSH_SET, atof(argv[i++]));
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "format") || !strcmp(argv[i] + 1, "f")) {
i++;
if(argv[i] != NULL) {
if(!strcmp(argv[i], "msh") ||
!strcmp(argv[i], "MSH") || !strcmp(argv[i], "gmsh")) {
CTX.mesh.format = FORMAT_MSH;
}
else if(!strcmp(argv[i], "unv") ||
!strcmp(argv[i], "UNV") || !strcmp(argv[i], "ideas")) {
CTX.mesh.format = FORMAT_UNV;
}
else if(!strcmp(argv[i], "gref") ||
!strcmp(argv[i], "GREF") || !strcmp(argv[i], "Gref")) {
CTX.mesh.format = FORMAT_GREF;
}
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, "algo")) {
i++;
if(argv[i] != NULL) {
if(!strncmp(argv[i], "iso", 3))
CTX.mesh.algo = DELAUNAY_ISO;
else if(!strncmp(argv[i], "tri", 3))
CTX.mesh.algo = DELAUNAY_SHEWCHUK;
else if(!strncmp(argv[i], "aniso", 5))
CTX.mesh.algo = DELAUNAY_ANISO;
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, "version") ||
!strcmp(argv[i] + 1, "-version")) {
fprintf(stderr, "%d.%d.%d\n", GMSH_MAJOR_VERSION, GMSH_MINOR_VERSION,
GMSH_PATCH_VERSION);
exit(1);
}
else if(!strcmp(argv[i] + 1, "info") || !strcmp(argv[i] + 1, "-info")) {
fprintf(stderr, "%s\n", gmsh_progname);
fprintf(stderr, "%s\n", gmsh_copyright);
fprintf(stderr, "%s%d.%d.%d\n", gmsh_version, GMSH_MAJOR_VERSION,
GMSH_MINOR_VERSION, GMSH_PATCH_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, "noterm")) {
CTX.terminal = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "term")) {
CTX.terminal = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "alpha")) {
CTX.alpha = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "notrack")) {
CTX.useTrackball = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "dual")) {
CTX.mesh.dual = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "interactive")) {
CTX.mesh.interactive = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "noview")) {
opt_view_visible(0, GMSH_SET, 0);
i++;
}
else if(!strcmp(argv[i] + 1, "plugin")) {
opt_general_default_plugins(0, GMSH_SET, 1);
i++;
}
else if(!strcmp(argv[i] + 1, "noplugin")) {
opt_general_default_plugins(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, "fill")) {
opt_view_intervals_type(0, GMSH_SET, DRAW_POST_CONTINUOUS);
i++;
}
else if(!strcmp(argv[i] + 1, "smoothview")) {
CTX.post.smooth = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nbiso")) {
i++;
if(argv[i] != NULL)
opt_view_nb_iso(0, GMSH_SET, atoi(argv[i++]));
else {
fprintf(stderr, ERROR_STR "Missing number\n");
exit(1);
}
}
else if(!strcmp(argv[i] + 1, "command") || !strcmp(argv[i] + 1, "c")) {
CTX.command_win = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nocommand") ||
!strcmp(argv[i] + 1, "noc")) {
CTX.command_win = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "overlay") || !strcmp(argv[i] + 1, "ov")) {
CTX.overlay = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nooverlay") ||
!strcmp(argv[i] + 1, "noov")) {
CTX.overlay = CTX.geom.highlight = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "hh")) {
CTX.overlay = 0;
CTX.geom.highlight = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "perspective") ||
!strcmp(argv[i] + 1, "p")) {
CTX.ortho = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "ortho") || !strcmp(argv[i] + 1, "o")) {
CTX.ortho = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "threads")) {
CTX.threads = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nothreads")) {
CTX.threads = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "db")) {
CTX.db = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nodb")) {
CTX.db = 0;
CTX.geom.highlight = 0;
i++;
}
else if(!strcmp(argv[i] + 1, "dl")) {
CTX.post.display_lists = 1;
i++;
}
else if(!strcmp(argv[i] + 1, "nodl")) {
CTX.post.display_lists = 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")) {
i++;
if(argv[i] != NULL) {
CTX.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
else {
#if defined(__APPLE__)
// The Mac Finder launches programs with special command line
// arguments: just ignore them (and don't exit!)
fprintf(stderr, "Unknown option '%s'\n", argv[i]);
i++;
#else
fprintf(stderr, "Unknown option '%s'\n", argv[i]);
CTX.terminal = 1;
Print_Usage(argv[0]);
exit(1);
#endif
}
}
else {
if(*nbfiles < MAX_OPEN_FILES)
TheFileNameTab[(*nbfiles)++] = argv[i++];
else {
fprintf(stderr, ERROR_STR "Too many input files\n");
exit(1);
}
}
}
strncpy(CTX.filename, TheFileNameTab[0], 255);
}
#ifndef _COMMAND_LINE_H_
#define _COMMAND_LINE_H_
// Copyright (C) 1997-2003 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".
#define MAX_OPEN_FILES 256
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[];
extern char *TheFileNameTab[MAX_OPEN_FILES], *TheBgmFileName, *TheOptString;
void Get_Options(int argc, char *argv[], int *nbfiles);
void Print_Usage(char *name);
char *Get_BuildOptions(void);
#endif
// $Id: Context.cpp,v 1.49 2003-03-21 00:52:35 geuzaine Exp $
//
// Copyright (C) 1997-2003 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 "Gmsh.h"
#include "Numeric.h"
#include "Geo.h"
#include "Mesh.h"
#include "Draw.h"
#include "Context.h"
#include "Options.h"
#include "DefaultOptions.h"
#include "Trackball.h"
/*
3 successive rotations along x, y and z:
c(y)c(z) s(x)s(y)c(z)+c(x)s(z) -c(x)s(y)c(z)+s(x)s(z)
t[][] = -c(y)s(z) -s(x)s(y)s(z)+c(x)c(z) c(x)s(y)s(z)+s(x)c(z)
s(y) -s(x)c(y) c(x)c(y)
get the position angles:
y = asin(t31)
Pi - asin(t31)
si y != +- Pi/2 :
x = atan(-t32/t33) si t33 cos y > 0
atan(-t32/t33)+Pi si t33 cos y < 0
z = atan(-t21/t11) si t11 cos y > 0
atan(-t21/t11)+Pi si t11 cos y < 0
*/
void Context_T::buildRotmatrix(void)
{
double x, y, z;
if(useTrackball) {
build_rotmatrix(rot, quaternion);
#if defined(HAVE_FLTK)
// We should reconstruct the Euler angles from the rotation
// matrix. I'm too lazy to do it :-(
extern void set_r(int i, double val);
set_r(0, 0.);
set_r(1, 0.);
set_r(2, 0.);
/*
double x=0., y=0., z=0.
y = asin(rot[2][0]) ; y = Pi - asin(rot[2][0]) ; // choix ???
if(fabs(y) != Pi/2.){
if(rot[2][2]*cos(y) > 0.) x = atan2(-rot[2][1],rot[2][2]);
else x = atan2(-rot[2][1],rot[2][2]) + Pi;
if(rot[0][0]*cos(y) > 0.) z = atan2(-rot[1][0],rot[0][0]);
else z = atan2(-rot[1][0],rot[0][0]) + Pi;
}
set_r(0, x * 180./Pi);
set_r(1, y * 180./Pi);
set_r(2, z * 180./Pi);
*/
/*
double r0, r1, r2;
r1 = atan2(-rot[0][2],sqrt(rot[1][2]*rot[1][2] + rot[2][2]*rot[2][2]));
double c = cos(r1);
if(c != 0.0){
r0 = atan2(rot[1][2]/c,rot[2][2]/c) ;
r2 = atan2(-rot[1][0]/c,rot[0][0]/c) ;
r0 *= 180./(Pi);
r2 *= 180./(Pi);
}
set_r(0, r0);
set_r(1, r1 * 180./(Pi)); // lazyyyyyy
set_r(2, r2);
*/
#endif
}
else {
x = r[0] * Pi / 180.;
y = r[1] * Pi / 180.;
z = r[2] * Pi / 180.;
rot[0][0] = cos(y) * cos(z);
rot[0][1] = sin(x) * sin(y) * cos(z) + cos(x) * sin(z);
rot[0][2] = -cos(x) * sin(y) * cos(z) + sin(x) * sin(z);
rot[0][3] = 0.0;
rot[1][0] = -cos(y) * sin(z);
rot[1][1] = -sin(x) * sin(y) * sin(z) + cos(x) * cos(z);
rot[1][2] = cos(x) * sin(y) * sin(z) + sin(x) * cos(z);
rot[1][3] = 0.0;
rot[2][0] = sin(y);
rot[2][1] = -sin(x) * cos(y);
rot[2][2] = cos(x) * cos(y);
rot[2][3] = 0.0;
rot[3][0] = 0.0;
rot[3][1] = 0.0;
rot[3][2] = 0.0;
rot[3][3] = 1.0;
}
}
void Context_T::addQuaternion(float p1x, float p1y, float p2x, float p2y)
{
float quat[4];
trackball(quat, p1x, p1y, p2x, p2y);
add_quats(quat, quaternion, quaternion);
}
void Context_T::setQuaternion(float q0, float q1, float q2, float q3)
{
quaternion[0] = q0;
quaternion[1] = q1;
quaternion[2] = q2;
quaternion[3] = q3;
}
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
// Copyright (C) 1997-2003 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"
// How RGBA values are packed and unpacked into/from a 4-byte
// integer. Don't use 'LITTLE_ENDIAN': Apple defines it in its system
// headers.
#if defined(_BIG_ENDIAN)
# define PACK_COLOR(R,G,B,A) ( (R)<<24 | (G)<<16 | (B)<<8 | (A) )
# define UNPACK_RED(X) ( ( (X) >> 24 ) & 0xff )
# define UNPACK_GREEN(X) ( ( (X) >> 16 ) & 0xff )
# define UNPACK_BLUE(X) ( ( (X) >> 8 ) & 0xff )
# define UNPACK_ALPHA(X) ( (X) & 0xff )
#else
# define PACK_COLOR(R,G,B,A) ( (A)<<24 | (B)<<16 | (G)<<8 | (R) )
# define UNPACK_RED(X) ( (X) & 0xff )
# define UNPACK_GREEN(X) ( ( (X) >> 8 ) & 0xff )
# define UNPACK_BLUE(X) ( ( (X) >> 16 ) & 0xff )
# define UNPACK_ALPHA(X) ( ( (X) >> 24 ) & 0xff )
#endif
// Interface-independent context
class Context_T {
public :
// general options
char filename[256]; // the name of the currently opened file
char base_filename[256]; // the same without the extension
char *output_filename; // output file specified with command line option '-o'
char *default_filename; // the name of the default file
char *tmp_filename; // the name of the temp file
char *session_filename, sessionrc_filename[256];
// the name of the sessionrc configuration file
char *options_filename, optionsrc_filename[256];
// the name of the optionrc configuration file
char *error_filename; // the name of the error file
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 home_dir[256]; // the home directory
char *theme; // 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 stat_position[2]; // position of the statistics window on the screen
int center_windows; // center popup windows on the menu window
int default_plugins; // do we load default plugins on startup?
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 expose; // 1 if everything is ready to expose and draw
float rot[4][4]; // current rotation matrix
double r[3]; // position angles (if succ. rot. along x, y and z)
double t[3], s[3]; // current translation and scale
int rlock[3], tlock[3], slock[3];
// locks for r, t and s
float quaternion[4]; // the actual quaternion used for "trackball" rotating
int useTrackball; // do or do not use the trackball for rotations
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 range[3]; // maximum range in the three directions
double lc, lc_middle; // characteristic lengths for the whole problem,
double lc_order; // and never used in mesh generation (->only for geo/post)
int db; // double buffer?
int overlay; // overlay graphic window?
int ortho; // orthogonal projection?
int fast; // inhibit mesh and postpro drawing when changing r,s,t
int command_win; // command window?
int axes, small_axes; // draw axes?
int small_axes_pos[2]; // small axes position
int threads, threads_lock; // threads?, lock (should be a mutex...)
int alpha; // enable alpha blending
double zoom_factor; // mouse2 zoom coefficient
int fontsize; // font size for fltk UI
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 light
float light_position[6][4]; // light sources positions
int moving_light; // type of light (follows the model or not)
float shine; // specular value
int render_mode; // GMSH_RENDER, GMSH_SELECT, GMSH_FEEDBACK
int clip[6]; // status of clip planes
double clip_plane[6][4]; // clip planes
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)
// geometry options
struct{
int vis_type;
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; // flat or 3D
int hidden, shade;
int highlight;
int level, old_circle, circle_points, extrude_spline_points, old_newreg;
double normals, tangents;
double scaling_factor;
int color_scheme ;
int auto_coherence;
} geom;
// mesh options
struct {
int vis_type, changed, display_lists;
int draw;
int points, lines, surfaces, volumes;
int points_num, lines_num, surfaces_num, volumes_num;
int point_type, line_type; // flat or 3D
double point_size, line_width;
double quality;
double gamma_inf, gamma_sup, radius_inf, radius_sup;
double scaling_factor, lc_factor, rand_factor;
int dual, interactive;
int hidden, shade;
int format, nb_smoothing, algo, degree;
int point_insertion, speed_max, min_circ_points, constrained_bgmesh;
int histogram, initial_only;
double normals, tangents, explode;
int color_scheme, color_carousel ;
int use_cut_plane;
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 oldxtrude, oldxtrude_recombine, check_duplicates;
int allow_degenerated_extrude, save_all;
} mesh;
// post processing options
struct{
List_T *list ;
int force_num, compute_bb, display_lists;
int draw, scales, link ;
int smooth, anim_cycle ;
double anim_delay ;
}post;
// print options
struct{
int format;
int eps_quality, eps_background, eps_font_size;
int eps_occlusion_culling, eps_best_root;
char *eps_font;
double eps_line_width_factor, eps_point_size_factor;
int jpeg_quality;
int gif_dither, gif_sort, gif_interlace, gif_transparent;
int gl_fonts;
} print;
// color options
struct{
unsigned int bg, fg, text, axes, small_axes;
struct{
unsigned int point, line, surface, volume;
unsigned int point_sel, line_sel, surface_sel, volume_sel;
unsigned int point_hlt, line_hlt, surface_hlt, volume_hlt;
unsigned int tangents, normals;
} geom;
struct{
unsigned int vertex, vertex_supp, line, triangle, quadrangle;
unsigned int tetrahedron, hexahedron, prism, pyramid;
unsigned int carousel[10];
unsigned int tangents, normals;
} mesh;
} color;
// trackball functions
void buildRotmatrix(void);
void setQuaternion (float p1x, float p1y, float p2x, float p2y);
void addQuaternion (float p1x, float p1y, float p2x, float p2y);
};
#endif
#ifndef _DEFAULT_OPTIONS_H_
#define _DEFAULT_OPTIONS_H_
// Copyright (C) 1997-2003 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".
// 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|S, "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|S, "ErrorFileName" , opt_general_error_filename , ".gmsh-errors" ,
"File into which the log is saved if a fatal error occurs" },
{ F|S, "OptionsFileName" , opt_general_options_filename , ".gmsh-options" ,
"File created in your home directory with 'Tools->Options->Save', and which is read on startup" },
{ 0, "SessionFileName" , opt_general_session_filename , ".gmshrc" ,
"File into which session specific information is saved, and which is read on startup" },
#if defined(WIN32)
{ F|O, "TextEditor" , opt_general_editor , "notepad.exe %s" ,
#else
{ F|O, "TextEditor" , opt_general_editor , "emacs %s &" ,
#endif
"System command to launch a text editor" },
{ F|O, "Theme" , opt_general_theme , "" ,
"Graphical user interface theme (try e.g. plastic)" },
{ F|S, "TmpFileName" , opt_general_tmp_filename , ".gmsh-tmp" ,
"Temporary file (created in your home directory)" },
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString GeometryOptions_String[] = {
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString MeshOptions_String[] = {
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString SolverOptions_String[] = {
{ 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-2003\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, "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 , "-bin -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, "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, "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, "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, "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, "AbscissaName" , opt_view_abscissa_name , "" ,
"Abscissa name for 2D graphs" },
{ F|O, "AbscissaFormat" , opt_view_abscissa_format , "%.3e" ,
"Abscissa number format for 2D graphs (in standard C form)" },
{ F, "FileName" , opt_view_filename , "" ,
"Default file name to assign to the post-processing view" },
{ F|O, "Format" , opt_view_format , "%.3e" ,
"Number format (in standard C form)" },
{ F, "Name" , opt_view_name , "" ,
"Default name to assign to the post-processing view" },
{ 0, NULL , NULL , NULL , NULL }
} ;
StringXString PrintOptions_String[] = {
{ F|O, "EpsFont" , opt_print_eps_font , "Courier" ,
"Font used for postscript printing" },
{ 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, "Axes" , opt_general_axes , 1. ,
"Display the axes linked to the model" },
{ F|O, "CenterWindows" , opt_general_center_windows , 1. ,
"Center new windows on the menu window" },
{ F, "Clip0" , opt_general_clip0 , 0. ,
"Enable clip plane 0" },
{ F, "Clip0A" , opt_general_clip0a , 0.0 ,
"First clip plane 0 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip0B" , opt_general_clip0b , 0.0 ,
"Second clip plane 0 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip0C" , opt_general_clip0c , 0.0 ,
"Third clip plane 0 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip0D" , opt_general_clip0d , 0.0 ,
"Fourth clip plane 0 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip1" , opt_general_clip1 , 0.,
"Enable clip plane 1" },
{ F, "Clip1A" , opt_general_clip1a , 0.0 ,
"First clip plane 1 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip1B" , opt_general_clip1b , 0.0 ,
"Second clip plane 1 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip1C" , opt_general_clip1c , 0.0 ,
"Third clip plane 1 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip1D" , opt_general_clip1d , 0.0 ,
"Fourth clip plane 1 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip2" , opt_general_clip2 , 0.,
"Enable clip plane 2" },
{ F, "Clip2A" , opt_general_clip2a , 0.0 ,
"First clip plane 2 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip2B" , opt_general_clip2b , 0.0 ,
"Second clip plane 2 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip2C" , opt_general_clip2c , 0.0 ,
"Third clip plane 2 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip2D" , opt_general_clip2d , 0.0 ,
"Fourth clip plane 2 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip3" , opt_general_clip3 , 0.,
"Enable clip plane 3" },
{ F, "Clip3A" , opt_general_clip3a , 0.0 ,
"First clip plane 3 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip3B" , opt_general_clip3b , 0.0 ,
"Second clip plane 3 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip3C" , opt_general_clip3c , 0.0 ,
"Third clip plane 3 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip3D" , opt_general_clip3d , 0.0 ,
"Fourth clip plane 3 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip4" , opt_general_clip4 , 0.,
"Enable clip plane 4" },
{ F, "Clip4A" , opt_general_clip4a , 0.0 ,
"First clip plane 4 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip4B" , opt_general_clip4b , 0.0 ,
"Second clip plane 4 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip4C" , opt_general_clip4c , 0.0 ,
"Third clip plane 4 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip4D" , opt_general_clip4d , 0.0 ,
"Fourth clip plane 4 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip5" , opt_general_clip5 , 0.,
"Enable clip plane 5" },
{ F, "Clip5A" , opt_general_clip5a , 0.0 ,
"First clip plane 5 equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip5B" , opt_general_clip5b , 0.0 ,
"Second clip plane 5 equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip5C" , opt_general_clip5c , 0.0 ,
"Third clip plane 5 equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "Clip5D" , opt_general_clip5d , 0.0 ,
"Fourth clip plane 5 equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F|O, "ColorScheme", opt_general_color_scheme , 0. ,
"Default color scheme (0, 1 or 2)" },
{ F|S, "ConfirmOverwrite" , opt_general_confirm_overwrite, 1. ,
"Ask confirmation before overwriting files?" },
{ F|O, "DefaultPlugins" , opt_general_default_plugins , 1. ,
"Load default plugins on startup" },
{ 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, "FastRedraw" , opt_general_fast_redraw , 1. ,
"Fast redraw (no mesh or view display) when moving the model" },
{ F|S, "FontSize" , opt_general_fontsize , 12. ,
"Size of the font in the graphical user interface" },
{ F|S, "GraphicsFontSize" , opt_general_graphics_fontsize , 11. ,
"Size of the font in the graphic window" },
{ F|S, "GraphicsHeight" , opt_general_viewport3 , 500. ,
"Height (in pixels) of the graphic window" },
{ F|S, "GraphicsPositionX" , opt_general_graphics_position0 , 20. ,
"Horizontal position (in pixels) of the upper left corner of the graphic window" },
{ F|S, "GraphicsPositionY" , opt_general_graphics_position1 , 30. ,
"Vertical position (in pixels) of the upper left corner of the graphic window" },
{ F|S, "GraphicsWidth" , opt_general_viewport2 , 700. ,
"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.5 ,
"X position of light source 0" },
{ F|O, "Light0Y" , opt_general_light01 , 0.3 ,
"Y position of light source 0" },
{ F|O, "Light0Z" , opt_general_light02 , 1.0 ,
"Z position of light source 0" },
{ 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, "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, "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, "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, "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, "LineWidth" , opt_general_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ 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|O, "MovingLight" , opt_general_moving_light , 0. ,
"Use a moving (i.e. which follows the model) light source" },
{ 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|O, "PointSize" , opt_general_point_size , 3. ,
"Display size of points (in pixels)" },
{ F|O, "QuadricSubdivisions" , opt_general_quadric_subdivisions, 10. ,
"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|S, "SaveOptions" , opt_general_options_save, 0. ,
"Automatically save all current options each time you quit Gmsh?" },
{ F|S, "SaveSession" , opt_general_session_save, 1. ,
"Automatically save session specific information 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 (must be > 0)" },
{ F|O, "SmallAxes" , opt_general_small_axes , 1. ,
"Display the small axes" },
{ F|O, "SmallAxesPositionX" , opt_general_small_axes_position0 , -45. ,
"X position of small axes (negative values for right alignment)" },
{ F|O, "SmallAxesPositionY" , opt_general_small_axes_position1 , -35. ,
"Y position of small axes (negative values for bottom alignment)" },
{ 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" },
#if defined(HAVE_FLTK)
{ F|O, "Terminal" , opt_general_terminal , 0. ,
#else
{ F|O, "Terminal" , opt_general_terminal , 1. ,
#endif
"Should information be printed on the terminal (if available)?" },
{ F|O, "Tooltips" , opt_general_tooltips , 1. ,
"Show tooltips in the graphical 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 Trackball == 1)" },
{ F, "TrackballQuaternion1" , opt_general_quaternion1 , 0.0 ,
"Second trackball quaternion component (used if Trackball == 1)" },
{ F, "TrackballQuaternion2" , opt_general_quaternion2 , 0.0 ,
"Third trackball quaternion component (used if Trackball == 1)" },
{ F, "TrackballQuaternion3" , opt_general_quaternion3 , 1.0 ,
"Fourth trackball quaternion component (used if 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, "Verbosity" , opt_general_verbosity , 2. ,
"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 , 1.1 ,
"'Speed' of the middle mouse button zoom" },
{ 0, NULL , NULL , 0. , NULL }
} ;
StringXNumber GeometryOptions_Number[] = {
{ F|O, "Aspect" , opt_geometry_aspect , 0. ,
"Not used" },
{ 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, "ColorScheme" , opt_geometry_color_scheme , 0. ,
"Default geometry color scheme (0, 1 or 2)" },
{ F|O, "ExtrudeSplinePoints" , opt_geometry_extrude_spline_points, 5. ,
"Number of control points for splines created during extrusion" },
{ F|O, "Highlight" , opt_geometry_highlight , 1. ,
"Not used" },
{ F|O, "Lines" , opt_geometry_lines , 1. ,
"Display geometry curves?" },
{ F|O, "LinesNumbers" , 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 or 3D cylinders" },
{ F|O, "LineWidth" , opt_geometry_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ F|O, "Normals" , opt_geometry_normals , 0. ,
"Size of the vectors normal to the surfaces" },
{ 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, "PointsNumbers" , 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 , 3. ,
"Display size of points (in pixels)" },
{ F|O, "PointType" , opt_geometry_point_type , 0. ,
"Display points as solid color dots or 3D spheres" },
{ F|O, "ScalingFactor" , opt_geometry_scaling_factor , 1.0 ,
"Global geometry scaling factor" },
{ F|O, "Surfaces" , opt_geometry_surfaces , 0. ,
"Display geometry surfaces?" },
{ F|O, "SurfacesNumbers" , opt_geometry_surfaces_num , 0. ,
"Display surface numbers?" },
{ F|O, "Tangents" , opt_geometry_tangents , 0. ,
"Size of the vectors tangent to the curves" },
{ F|O, "Volumes" , opt_geometry_volumes , 0. ,
"Display geometry volumes? (not implemented yet)" },
{ F|O, "VolumesNumbers" , opt_geometry_volumes_num , 0. ,
"Display volume numbers? (not implemented yet)" },
{ 0, NULL , NULL , 0. , NULL }
} ;
StringXNumber MeshOptions_Number[] = {
{ F|O, "Algorithm" , opt_mesh_algo , DELAUNAY_ISO ,
"2D mesh algorithm (1=isotropic, 2=anisotropic, 3=triangle)" },
{ F, "AllowDegeneratedExtrude" , opt_mesh_allow_degenerated_extrude , 0. ,
"Allow the generation of degenerated hexahedra or prisms during extrusion" },
{ F|O, "Aspect" , opt_mesh_aspect , 0. ,
"Mesh aspect (0=wireframe, 1=hidden lines, 2=solid)" },
{ F|O, "CharacteristicLengthFactor" , opt_mesh_lc_factor , 1.0 ,
"Factor applied to all characteristic lengths (and background meshes)" },
{ F|O, "ColorCarousel" , opt_mesh_color_carousel , 1. ,
"Use a 'color by region number' scheme" },
{ F|O, "ColorScheme" , opt_mesh_color_scheme , 0. ,
"Default mesh color scheme (0, 1 or 2)" },
{ 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 for the generation of the current mesh (in seconds)" },
{ F, "CutPlane" , opt_mesh_use_cut_plane , 0 ,
"Enable mesh cut plane" },
{ F, "CutPlaneA" , opt_mesh_cut_planea , 1. ,
"First cut plane equation coefficient ('A' in equation 'AX+BY+CZ+D=0')" },
{ F, "CutPlaneB" , opt_mesh_cut_planeb , 0. ,
"Second cut plane equation coefficient ('B' in equation 'AX+BY+CZ+D=0')" },
{ F, "CutPlaneC" , opt_mesh_cut_planec , 0. ,
"Third cut plane equation coefficient ('C' in equation 'AX+BY+CZ+D=0')" },
{ F, "CutPlaneD" , opt_mesh_cut_planed , 0. ,
"Fourth cut plane equation coefficient ('D' in equation 'AX+BY+CZ+D=0')" },
{ F|O, "Degree" , opt_mesh_degree , 1. ,
"Element order" },
{ F|O, "DisplayLists" , opt_mesh_display_lists , 0. ,
"Use OpenGL display lists for drawing meshes" },
{ F|O, "Dual" , opt_mesh_dual , 0. ,
"Display the dual mesh obtained by barycentric subdivision" },
{ F|O, "Explode" , opt_mesh_explode , 1.0 ,
"Display mesh with non adjacent elements (factor between 0 and 1)" },
{ F|O, "Format" , opt_mesh_format , FORMAT_MSH ,
"Mesh output format (1=MSH, 2=UNV)" },
{ F|O, "GammaInf" , opt_mesh_gamma_inf , 0.0 ,
"Only display elements whose Gamma factor is greater than GammaInf" },
{ F|O, "GammaSup" , opt_mesh_gamma_sup , 0.0 ,
"Only display elements whose Gamma factor is smaller than GammaSup" },
{ F|O, "Interactive" , opt_mesh_interactive , 0. ,
"Show the construction of the 2D mesh in real time (only with the anisotropic algorithm)" },
{ F|O, "Lines" , opt_mesh_lines , 1. ,
"Display mesh vertices on curves?" },
{ F|O, "LinesNumbers" , opt_mesh_lines_num , 0. ,
"Display mesh line numbers?" },
{ F|O, "LineType" , opt_mesh_line_type , 0. ,
"Display lines as solid color segments or 3D cylinders" },
{ F|O, "LineWidth" , opt_mesh_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ F|O, "MinimumCirclePoints" , opt_mesh_min_circ_points, 7. ,
"Minimum number of points used to mesh a circle" },
{ F, "NbHexahedra" , opt_mesh_nb_hexahedra , 0. ,
"Number of hexahedra in the current mesh" },
{ F, "NbNodes" , opt_mesh_nb_nodes , 0. ,
"Number of nodes in the current mesh" },
{ F, "NbPrisms" , opt_mesh_nb_prisms , 0. ,
"Number of prisms in the current mesh" },
{ F, "NbPyramids" , opt_mesh_nb_pyramids , 0. ,
"Number of pyramids in the current mesh" },
{ F, "NbQuadrangles" , opt_mesh_nb_quadrangles , 0. ,
"Number of quadrangles in the current mesh" },
{ F, "NbTetrahedra" , opt_mesh_nb_tetrahedra , 0. ,
"Number of tetrahedra in the current mesh" },
{ F, "NbTriangles" , opt_mesh_nb_triangles , 0. ,
"Number of triangles in the current mesh" },
{ F|O, "Normals" , opt_mesh_normals , 0.0 ,
"Size of the normal vectors" },
{ F|O, "Points" , opt_mesh_points , 1. ,
"Display mesh vertices?" },
{ F|O, "PointInsertion" , opt_mesh_point_insertion, CENTER_CIRCCIRC ,
"Point insertion method for isotropic 2D algorithm (1=center of circ. circle, 2=voronoi, 3=cog)" },
{ F|O, "PointsNumbers" , opt_mesh_points_num , 0. ,
"Display mesh vertices numbers?" },
{ F|O, "PointSize" , opt_mesh_point_size , 2. ,
"Display size of points (in pixels)" },
{ F|O, "PointType" , opt_mesh_point_type , 0. ,
"Display points as solid color dots or 3D spheres" },
{ F|O, "Quality" , opt_mesh_quality , 0.0 ,
"Target quality for tetrahedral elements (not fully functional)" },
{ F|O, "RadiusInf" , opt_mesh_radius_inf , 0.0 ,
"Only display elements whose Radius is greater than RadiusInf" },
{ F|O, "RadiusSup" , opt_mesh_radius_sup , 0.0 ,
"Only display elements whose Radius is smaller than RadiusSup" },
{ F|O, "RandomFactor" , opt_mesh_rand_factor , 1.e-4 ,
"Random factor used in 2D and 3D meshing algorithm (test other values when the algorithm fails)" },
{ F, "SaveAll" , opt_mesh_save_all , 0. ,
"Ignore Physical definitions and save all elements" },
{ F|O, "ScalingFactor" , opt_mesh_scaling_factor , 1.0 ,
"Global scaling factor applied to the saved mesh" },
{ F|O, "Smoothing" , opt_mesh_nb_smoothing , 0. ,
"Number of smoothing steps applied to the final mesh" },
{ F|O, "SpeedMax" , opt_mesh_speed_max , 0. ,
"Disable dubious point insertion tests" },
{ F|O, "Surfaces" , opt_mesh_surfaces , 1. ,
"Display surface mesh?" },
{ F|O, "SurfacesNumbers" , opt_mesh_surfaces_num , 0. ,
"Display mesh surface numbers?" },
{ F|O, "Tangents" , opt_mesh_tangents , 0.0 ,
"Size of the tangent vectors" },
{ F|O, "Volumes" , opt_mesh_volumes , 1. ,
"Display volume mesh?" },
{ F|O, "VolumesNumbers" , opt_mesh_volumes_num , 0. ,
"Display mesh elements numbers?" },
{ 0, NULL , NULL , 0. , NULL }
} ;
StringXNumber SolverOptions_Number[] = {
{ F|O, "ClientServer0" , opt_solver_client_server0 , 1. ,
"Connect solver 0 to the Gmsh server" },
{ F|O, "MergeViews0" , opt_solver_merge_views0 , 1. ,
"Automatically merge any post-processing view created by solver 0" },
#if defined(WIN32)
{ F|O, "PopupMessages0" , opt_solver_popup_messages0 , 0. , // we already have the transient dos window
#else
{ F|O, "PopupMessages0" , opt_solver_popup_messages0 , 1. ,
#endif
"Automatically display messages produced by solver 0" },
{ F|O, "ClientServer1" , opt_solver_client_server1 , 0. ,
"Connect solver 1 to the Gmsh server" },
{ F|O, "MergeViews1" , opt_solver_merge_views1 , 1. ,
"Automatically merge any post-processing view created by solver 1" },
{ F|O, "PopupMessages1" , opt_solver_popup_messages1 , 1. ,
"Automatically display messages produced by solver 1" },
{ F|O, "ClientServer2" , opt_solver_client_server2 , 0. ,
"Connect solver 2 to the Gmsh server" },
{ F|O, "MergeViews2" , opt_solver_merge_views2 , 1. ,
"Automatically merge any post-processing view created by solver 2" },
{ F|O, "PopupMessages2" , opt_solver_popup_messages2 , 1. ,
"Automatically display messages produced by solver 2" },
{ F|O, "ClientServer3" , opt_solver_client_server3 , 0. ,
"Connect solver 3 to the Gmsh server" },
{ F|O, "MergeViews3" , opt_solver_merge_views3 , 1. ,
"Automatically merge any post-processing view created by solver 3" },
{ F|O, "PopupMessages3" , opt_solver_popup_messages3 , 1. ,
"Automatically display messages produced by solver 3" },
{ F|O, "ClientServer4" , opt_solver_client_server4 , 0. ,
"Connect solver 4 to the Gmsh server" },
{ F|O, "MergeViews4" , opt_solver_merge_views4 , 1. ,
"Automatically merge any post-processing view created by solver 4" },
{ 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 to animation frames" },
{ F|O, "AnimationCycle" , opt_post_anim_cycle , 0. ,
"Cycle through views instead of time steps for the animation" },
{ F|O, "DisplayLists" , opt_post_display_lists , 0. ,
"Use OpenGL display lists for drawing post-processing views" },
{ 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. ,//this default val is not used
"Current number of views merged" },
{ F|O, "Scales" , opt_post_scales , 1. ,
"Show value scales" },
{ 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 , 15. ,
"Threshold angle below which we do not smooth the normals" },
{ F|O, "ArrowLocation" , opt_view_arrow_location , DRAW_POST_LOCATE_COG ,
"Arrow location (1=cog, 2=vertex)" },
{ F|O, "ArrowScale" , opt_view_arrow_scale , 50. ,
"Size of the vector (e.g. arrow size in pixels)" },
{ F|O, "ArrowType" , opt_view_arrow_type , DRAW_POST_ARROW ,
"Vector display type (1=segment, 2=arrow, 3=pyramid, 4=cone, 5=displacement)" },
{ F|O, "AutoPosition" , opt_view_auto_position , 1. ,
"Position the scale or the 2D graph automatically to avoid overlaps" },
{ F|O, "Boundary" , opt_view_boundary , 0 ,
"Draw the N-b dimensional boundary of the simplex (N=dimension, b=option value)" },
{ 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, "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, "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. ,
"Explode elements (0: reduced to point; 1: not transformed)" },
{ F|O, "Grid" , opt_view_grid , 2 ,
"Grid mode for 2D graphs (0=none, 1=simple, 2=frame, 3=grid)" },
{ F|O, "Height" , opt_view_size1 , 200. ,
"Height (in pixels) of the scale or 2D graph" },
{ F|O, "IntervalsType" , opt_view_intervals_type , DRAW_POST_CONTINUOUS ,
"Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)" },
{ F|O, "Light" , opt_view_light , 0. ,
"Enable light sources?" },
{ F|O, "LineType" , opt_view_line_type , 0. ,
"Display lines as solid color segments or 3D cylinders" },
{ F|O, "LineWidth" , opt_view_line_width , 1.0 ,
"Display width of lines (in pixels)" },
{ F, "Max" , opt_view_max , -1.e200 ,
"Maximum value in the view (do _not_ change this!)" },
{ F, "Min" , opt_view_min , 1.e200 ,
"Minimum value in the view (do _not_ change this!)" },
{ F|O, "NbAbscissa" , opt_view_nb_abscissa , 5. ,
"Number of abscissa intervals for 2D graphs" },
{ 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, "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 , 2. ,
"Display size of points (in pixels)" },
{ F|O, "PointType" , opt_view_point_type , 0. ,
"Display points as solid color dots or 3D spheres" },
{ F|O, "PositionX" , opt_view_position0 , 80. ,
"Horizontal position (in pixels) of the upper left corner of the scale or 2D graph" },
{ F|O, "PositionY" , opt_view_position1 , 50. ,
"Vertical position (in pixels) of the upper left corner of the scale or 2D graph" },
{ 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 , DRAW_POST_DEFAULT ,
"Value scale range type (1=default, 2=custom)" },
{ 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 , DRAW_POST_LINEAR ,
"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. ,
"Show time value (or time step) if NbTimeStep > 1?" },
{ F|O, "SmoothNormals" , opt_view_smooth_normals , 0. ,
"Smooth the normals?" },
{ F|O, "TensorType" , opt_view_tensor_type , 0. ,
"Tensor Visualization Type" },
{ F, "TimeStep" , opt_view_timestep , 0. ,
"Current time step displayed" },
{ F|O, "TransparentScale" , opt_view_transparent_scale , 1. ,
"Display a 'transparent' value scale?" },
{ F|O, "Type" , opt_view_type , DRAW_POST_3D ,
"Type of graph (1=3D, 2=2D-space, 3=2D-time)" },
{ 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 graph" },
{ 0, NULL , NULL , 0. , NULL }
} ;
StringXNumber PrintOptions_Number[] = {
{ F|O, "EpsBackground" , opt_print_eps_background , 1 ,
"Save image background in postscript output" },
{ F|O, "EpsFontSize" , opt_print_eps_font_size , 12. ,
"Font size used for postscript printing" },
{ F|O, "EpsLineWidthFactor" , opt_print_eps_line_width_factor , 0.2 ,
"Width factor for lines in postscript output" },
{ F|O, "EpsPointSizeFactor" , opt_print_eps_point_size_factor , 1. ,
"Size factor for points in postscript output" },
{ F|O, "EpsQuality" , opt_print_eps_quality , 1 ,
"Postscript quality (1=simple sort, 2=recursive sort)" },
{ F|O, "EpsOcclusionCulling" , opt_print_eps_occlusion_culling , 1 ,
"Cull occluded primitives (to reduce PostScript file size)" },
{ F|O, "EpsBestRoot" , opt_print_eps_best_root , 1 ,
"Try to minimize primitive splitting in recursive sort" },
{ F|O, "Format" , opt_print_format , FORMAT_AUTO ,
"File format (10=automatic)" },
{ 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)" },
{ 0, NULL , NULL , 0. }
} ;
// COLORS
// CONTRARY TO THE PRECEDING OPTIONS, THE ORDERING OF COLOR OPTIONS MATTERS !
StringXColor GeneralOptions_Color[] = {
{ F|O, "Background" , opt_general_color_background ,
PACK_COLOR(0, 0, 0, 255),
PACK_COLOR(255, 255, 255, 255),
PACK_COLOR(255, 255, 255, 255),
"Background color" },
{ F|O, "Foreground" , opt_general_color_foreground ,
PACK_COLOR(255, 255, 255, 255),
PACK_COLOR(0, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Foreground color" },
{ F|O, "Text" , opt_general_color_text ,
PACK_COLOR(255, 255, 255, 255),
PACK_COLOR(0, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Text color" },
{ F|O, "Axes" , opt_general_color_axes ,
PACK_COLOR(255, 255, 0, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Axes color" },
{ F|O, "SmallAxes" , opt_general_color_small_axes ,
PACK_COLOR(255, 255, 255, 255),
PACK_COLOR(0, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Small axes color" },
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
StringXColor GeometryOptions_Color[] = {
{ F|O, "Points" , opt_geometry_color_points ,
PACK_COLOR(178, 182, 129, 255) ,
PACK_COLOR(178, 182, 129, 255) ,
PACK_COLOR(0, 0, 0, 255),
"Normal geometry point color" },
{ F|O, "Lines" , opt_geometry_color_lines ,
PACK_COLOR(0, 0, 255, 255),
PACK_COLOR(0, 0, 255, 255),
PACK_COLOR(0, 0, 0, 255),
"Normal geometry curve color" },
{ F|O, "Surfaces" , opt_geometry_color_surfaces ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Normal geometry surface color" },
{ F|O, "Volumes" , opt_geometry_color_volumes ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Normal geometry volume color" },
{ F|O, "PointsSelect" , opt_geometry_color_points_select ,
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Selected geometry point color" },
{ F|O, "LinesSelect" , opt_geometry_color_lines_select ,
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Selected geometry curve color" },
{ F|O, "SurfacesSelect" , opt_geometry_color_surfaces_select ,
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Selected geometry surface color" },
{ F|O, "VolumesSelect" , opt_geometry_color_volumes_select ,
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Selected geometry volume color" },
{ F|O, "PointsHighlight" , opt_geometry_color_points_highlight ,
PACK_COLOR(0, 255, 0, 255),
PACK_COLOR(0, 255, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Highlighted geometry point color" },
{ F|O, "LinesHighlight" , opt_geometry_color_lines_highlight ,
PACK_COLOR(0, 0, 255, 255),
PACK_COLOR(0, 0, 255, 255),
PACK_COLOR(0, 0, 0, 255),
"Highlighted geometry curve color" },
{ F|O, "SurfacesHighlight" , opt_geometry_color_surfaces_highlight ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Highlighted geometry surface color" },
{ F|O, "VolumesHighlight" , opt_geometry_color_volumes_highlight ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Highlighted geometry volume color" },
{ F|O, "Tangents" , opt_geometry_color_tangents ,
PACK_COLOR(255, 255, 0, 255),
PACK_COLOR(255, 255, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Tangent geometry vectors color" },
{ F|O, "Normals" , opt_geometry_color_normals ,
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(255, 0, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Normal geometry vectors color" },
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
#define COL1 PACK_COLOR( 232, 210, 23, 255 )
#define COL2 PACK_COLOR( 226, 167, 29, 255 )
#define COL3 PACK_COLOR( 217, 113, 38, 255 )
#define COL4 PACK_COLOR( 201, 54, 54, 255 )
#define COL5 PACK_COLOR( 169, 12, 86, 255 )
#define COL6 PACK_COLOR( 114, 2, 141, 255 )
#define COL7 PACK_COLOR( 67, 30, 188, 255 )
#define COL8 PACK_COLOR( 44, 86, 211, 255 )
#define COL9 PACK_COLOR( 32, 145, 223, 255 )
#define COL10 PACK_COLOR( 25, 193, 230, 255 )
#define COLW PACK_COLOR( 255, 255, 255, 255 )
#define COLT PACK_COLOR( 160, 150, 255, 255 )
#define COLQ PACK_COLOR( 130, 120, 225, 255 )
#define COLP PACK_COLOR( 232, 210, 23, 255 )
#define COLY PACK_COLOR( 217, 113, 38, 255 )
StringXColor MeshOptions_Color[] = {
{ F|O, "Points" , opt_mesh_color_points ,
PACK_COLOR(0 , 123, 59 , 255),
PACK_COLOR(0 , 123, 59 , 255),
PACK_COLOR(0, 0, 0, 255),
"Mesh vertex color" },
{ F|O, "PointsSupp" , opt_mesh_color_points_supp ,
PACK_COLOR(255, 0, 255, 255),
PACK_COLOR(255, 0, 255, 255),
PACK_COLOR(0, 0, 0, 255),
"Mesh high order vertex color" },
{ F|O, "Lines" , opt_mesh_color_lines ,
PACK_COLOR(0, 255, 0, 255),
PACK_COLOR(0, 255, 0, 255),
PACK_COLOR(0, 0, 0, 255),
"Mesh line color" },
{ F|O, "Triangles" , opt_mesh_color_triangles ,
COLT, COLT, COLW, "Mesh triangle color (if ColorCarousel=0)" },
{ F|O, "Quadrangles" , opt_mesh_color_quadrangles ,
COLQ, COLQ, COLW, "Mesh quadrangle color (if ColorCarousel=0)" },
{ F|O, "Tetrahedra" , opt_mesh_color_tetrahedra ,
COLT, COLT, COLW, "Mesh tetrahedron color (if ColorCarousel=0)" },
{ F|O, "Hexahedra" , opt_mesh_color_hexahedra ,
COLQ, COLQ, COLW, "Mesh hexahedron color (if ColorCarousel=0)" },
{ F|O, "Prisms" , opt_mesh_color_prisms ,
COLP, COLP, COLW, "Mesh prism color (if ColorCarousel=0)" },
{ F|O, "Pyramids" , opt_mesh_color_pyramid ,
COLY, COLY, COLW, "Mesh pyramid color (if ColorCarousel=0)" },
{ F|O, "Tangents" , opt_mesh_color_tangents ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Tangent mesh vector color" },
{ F|O, "Normals" , opt_mesh_color_normals ,
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(128, 128, 128, 255),
PACK_COLOR(0, 0, 0, 255),
"Normal mesh vector color" },
{ F|O, "One" , opt_mesh_color_1 , COL1, COL1, COLW, "First color in color carousel" },
{ F|O, "Two" , opt_mesh_color_2 , COL2, COL2, COLW, "Second color in color carousel" },
{ F|O, "Three" , opt_mesh_color_3 , COL3, COL3, COLW, "Third color in color carousel" },
{ F|O, "Four" , opt_mesh_color_4 , COL4, COL4, COLW, "Fourth color in color carousel" },
{ F|O, "Five" , opt_mesh_color_5 , COL5, COL5, COLW, "Fifth color in color carousel" },
{ F|O, "Six" , opt_mesh_color_6 , COL6, COL6, COLW, "Sixth color in color carousel" },
{ F|O, "Seven" , opt_mesh_color_7 , COL7, COL7, COLW, "Seventh color in color carousel" },
{ F|O, "Eight" , opt_mesh_color_8 , COL8, COL8, COLW, "Eighth color in color carousel" },
{ F|O, "Nine" , opt_mesh_color_9 , COL9, COL9, COLW, "Ninth color in color carousel" },
{ F|O, "Ten" , opt_mesh_color_10 , COL10, COL10, COLW, "tenth color in color carousel" },
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
#undef COL1
#undef COL2
#undef COL3
#undef COL4
#undef COL5
#undef COL6
#undef COL7
#undef COL8
#undef COL9
#undef COL10
#undef COLW
StringXColor SolverOptions_Color[] = {
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
StringXColor PostProcessingOptions_Color[] = {
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
StringXColor ViewOptions_Color[] = {
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
StringXColor PrintOptions_Color[] = {
{ 0, NULL , NULL , 0, 0, 0 , NULL }
} ;
#undef S
#undef O
#undef F
#endif
// $Id: GPL.cpp,v 1.2 2003-03-21 00:52:35 geuzaine Exp $
//
// Copyright (C) 1997-2003 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 "Gmsh.h"
void print_gpl(void)
{
Msg(DIRECT, " GNU GENERAL PUBLIC LICENSE");
Msg(DIRECT, " Version 2, June 1991");
Msg(DIRECT, "");
Msg(DIRECT, " Copyright (C) 1989, 1991 Free Software Foundation, Inc.");
Msg(DIRECT, " 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA");
Msg(DIRECT, " Everyone is permitted to copy and distribute verbatim copies");
Msg(DIRECT, " of this license document, but changing it is not allowed.");
Msg(DIRECT, "");
Msg(DIRECT, " Preamble");
Msg(DIRECT, "");
Msg(DIRECT, " The licenses for most software are designed to take away your");
Msg(DIRECT, "freedom to share and change it. By contrast, the GNU General Public");
Msg(DIRECT, "License is intended to guarantee your freedom to share and change free");
Msg(DIRECT, "software--to make sure the software is free for all its users. This");
Msg(DIRECT, "General Public License applies to most of the Free Software");
Msg(DIRECT, "Foundation's software and to any other program whose authors commit to");
Msg(DIRECT, "using it. (Some other Free Software Foundation software is covered by");
Msg(DIRECT, "the GNU Library General Public License instead.) You can apply it to");
Msg(DIRECT, "your programs, too.");
Msg(DIRECT, "");
Msg(DIRECT, " When we speak of free software, we are referring to freedom, not");
Msg(DIRECT, "price. Our General Public Licenses are designed to make sure that you");
Msg(DIRECT, "have the freedom to distribute copies of free software (and charge for");
Msg(DIRECT, "this service if you wish), that you receive source code or can get it");
Msg(DIRECT, "if you want it, that you can change the software or use pieces of it");
Msg(DIRECT, "in new free programs; and that you know you can do these things.");
Msg(DIRECT, "");
Msg(DIRECT, " To protect your rights, we need to make restrictions that forbid");
Msg(DIRECT, "anyone to deny you these rights or to ask you to surrender the rights.");
Msg(DIRECT, "These restrictions translate to certain responsibilities for you if you");
Msg(DIRECT, "distribute copies of the software, or if you modify it.");
Msg(DIRECT, "");
Msg(DIRECT, " For example, if you distribute copies of such a program, whether");
Msg(DIRECT, "gratis or for a fee, you must give the recipients all the rights that");
Msg(DIRECT, "you have. You must make sure that they, too, receive or can get the");
Msg(DIRECT, "source code. And you must show them these terms so they know their");
Msg(DIRECT, "rights.");
Msg(DIRECT, "");
Msg(DIRECT, " We protect your rights with two steps: (1) copyright the software, and");
Msg(DIRECT, "(2) offer you this license which gives you legal permission to copy,");
Msg(DIRECT, "distribute and/or modify the software.");
Msg(DIRECT, "");
Msg(DIRECT, " Also, for each author's protection and ours, we want to make certain");
Msg(DIRECT, "that everyone understands that there is no warranty for this free");
Msg(DIRECT, "software. If the software is modified by someone else and passed on, we");
Msg(DIRECT, "want its recipients to know that what they have is not the original, so");
Msg(DIRECT, "that any problems introduced by others will not reflect on the original");
Msg(DIRECT, "authors' reputations.");
Msg(DIRECT, "");
Msg(DIRECT, " Finally, any free program is threatened constantly by software");
Msg(DIRECT, "patents. We wish to avoid the danger that redistributors of a free");
Msg(DIRECT, "program will individually obtain patent licenses, in effect making the");
Msg(DIRECT, "program proprietary. To prevent this, we have made it clear that any");
Msg(DIRECT, "patent must be licensed for everyone's free use or not licensed at all.");
Msg(DIRECT, "");
Msg(DIRECT, " The precise terms and conditions for copying, distribution and");
Msg(DIRECT, "modification follow.");
Msg(DIRECT, "");
Msg(DIRECT, " GNU GENERAL PUBLIC LICENSE");
Msg(DIRECT, " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION");
Msg(DIRECT, "");
Msg(DIRECT, " 0. This License applies to any program or other work which contains");
Msg(DIRECT, "a notice placed by the copyright holder saying it may be distributed");
Msg(DIRECT, "under the terms of this General Public License. The \"Program\", below,");
Msg(DIRECT, "refers to any such program or work, and a \"work based on the Program\"");
Msg(DIRECT, "means either the Program or any derivative work under copyright law:");
Msg(DIRECT, "that is to say, a work containing the Program or a portion of it,");
Msg(DIRECT, "either verbatim or with modifications and/or translated into another");
Msg(DIRECT, "language. (Hereinafter, translation is included without limitation in");
Msg(DIRECT, "the term \"modification\".) Each licensee is addressed as \"you\".");
Msg(DIRECT, "");
Msg(DIRECT, "Activities other than copying, distribution and modification are not");
Msg(DIRECT, "covered by this License; they are outside its scope. The act of");
Msg(DIRECT, "running the Program is not restricted, and the output from the Program");
Msg(DIRECT, "is covered only if its contents constitute a work based on the");
Msg(DIRECT, "Program (independent of having been made by running the Program).");
Msg(DIRECT, "Whether that is true depends on what the Program does.");
Msg(DIRECT, "");
Msg(DIRECT, " 1. You may copy and distribute verbatim copies of the Program's");
Msg(DIRECT, "source code as you receive it, in any medium, provided that you");
Msg(DIRECT, "conspicuously and appropriately publish on each copy an appropriate");
Msg(DIRECT, "copyright notice and disclaimer of warranty; keep intact all the");
Msg(DIRECT, "notices that refer to this License and to the absence of any warranty;");
Msg(DIRECT, "and give any other recipients of the Program a copy of this License");
Msg(DIRECT, "along with the Program.");
Msg(DIRECT, "");
Msg(DIRECT, "You may charge a fee for the physical act of transferring a copy, and");
Msg(DIRECT, "you may at your option offer warranty protection in exchange for a fee.");
Msg(DIRECT, "");
Msg(DIRECT, " 2. You may modify your copy or copies of the Program or any portion");
Msg(DIRECT, "of it, thus forming a work based on the Program, and copy and");
Msg(DIRECT, "distribute such modifications or work under the terms of Section 1");
Msg(DIRECT, "above, provided that you also meet all of these conditions:");
Msg(DIRECT, "");
Msg(DIRECT, " a) You must cause the modified files to carry prominent notices");
Msg(DIRECT, " stating that you changed the files and the date of any change.");
Msg(DIRECT, "");
Msg(DIRECT, " b) You must cause any work that you distribute or publish, that in");
Msg(DIRECT, " whole or in part contains or is derived from the Program or any");
Msg(DIRECT, " part thereof, to be licensed as a whole at no charge to all third");
Msg(DIRECT, " parties under the terms of this License.");
Msg(DIRECT, "");
Msg(DIRECT, " c) If the modified program normally reads commands interactively");
Msg(DIRECT, " when run, you must cause it, when started running for such");
Msg(DIRECT, " interactive use in the most ordinary way, to print or display an");
Msg(DIRECT, " announcement including an appropriate copyright notice and a");
Msg(DIRECT, " notice that there is no warranty (or else, saying that you provide");
Msg(DIRECT, " a warranty) and that users may redistribute the program under");
Msg(DIRECT, " these conditions, and telling the user how to view a copy of this");
Msg(DIRECT, " License. (Exception: if the Program itself is interactive but");
Msg(DIRECT, " does not normally print such an announcement, your work based on");
Msg(DIRECT, " the Program is not required to print an announcement.)");
Msg(DIRECT, "");
Msg(DIRECT, "These requirements apply to the modified work as a whole. If");
Msg(DIRECT, "identifiable sections of that work are not derived from the Program,");
Msg(DIRECT, "and can be reasonably considered independent and separate works in");
Msg(DIRECT, "themselves, then this License, and its terms, do not apply to those");
Msg(DIRECT, "sections when you distribute them as separate works. But when you");
Msg(DIRECT, "distribute the same sections as part of a whole which is a work based");
Msg(DIRECT, "on the Program, the distribution of the whole must be on the terms of");
Msg(DIRECT, "this License, whose permissions for other licensees extend to the");
Msg(DIRECT, "entire whole, and thus to each and every part regardless of who wrote it.");
Msg(DIRECT, "");
Msg(DIRECT, "Thus, it is not the intent of this section to claim rights or contest");
Msg(DIRECT, "your rights to work written entirely by you; rather, the intent is to");
Msg(DIRECT, "exercise the right to control the distribution of derivative or");
Msg(DIRECT, "collective works based on the Program.");
Msg(DIRECT, "");
Msg(DIRECT, "In addition, mere aggregation of another work not based on the Program");
Msg(DIRECT, "with the Program (or with a work based on the Program) on a volume of");
Msg(DIRECT, "a storage or distribution medium does not bring the other work under");
Msg(DIRECT, "the scope of this License.");
Msg(DIRECT, "");
Msg(DIRECT, " 3. You may copy and distribute the Program (or a work based on it,");
Msg(DIRECT, "under Section 2) in object code or executable form under the terms of");
Msg(DIRECT, "Sections 1 and 2 above provided that you also do one of the following:");
Msg(DIRECT, "");
Msg(DIRECT, " a) Accompany it with the complete corresponding machine-readable");
Msg(DIRECT, " source code, which must be distributed under the terms of Sections");
Msg(DIRECT, " 1 and 2 above on a medium customarily used for software interchange; or,");
Msg(DIRECT, "");
Msg(DIRECT, " b) Accompany it with a written offer, valid for at least three");
Msg(DIRECT, " years, to give any third party, for a charge no more than your");
Msg(DIRECT, " cost of physically performing source distribution, a complete");
Msg(DIRECT, " machine-readable copy of the corresponding source code, to be");
Msg(DIRECT, " distributed under the terms of Sections 1 and 2 above on a medium");
Msg(DIRECT, " customarily used for software interchange; or,");
Msg(DIRECT, "");
Msg(DIRECT, " c) Accompany it with the information you received as to the offer");
Msg(DIRECT, " to distribute corresponding source code. (This alternative is");
Msg(DIRECT, " allowed only for noncommercial distribution and only if you");
Msg(DIRECT, " received the program in object code or executable form with such");
Msg(DIRECT, " an offer, in accord with Subsection b above.)");
Msg(DIRECT, "");
Msg(DIRECT, "The source code for a work means the preferred form of the work for");
Msg(DIRECT, "making modifications to it. For an executable work, complete source");
Msg(DIRECT, "code means all the source code for all modules it contains, plus any");
Msg(DIRECT, "associated interface definition files, plus the scripts used to");
Msg(DIRECT, "control compilation and installation of the executable. However, as a");
Msg(DIRECT, "special exception, the source code distributed need not include");
Msg(DIRECT, "anything that is normally distributed (in either source or binary");
Msg(DIRECT, "form) with the major components (compiler, kernel, and so on) of the");
Msg(DIRECT, "operating system on which the executable runs, unless that component");
Msg(DIRECT, "itself accompanies the executable.");
Msg(DIRECT, "");
Msg(DIRECT, "If distribution of executable or object code is made by offering");
Msg(DIRECT, "access to copy from a designated place, then offering equivalent");
Msg(DIRECT, "access to copy the source code from the same place counts as");
Msg(DIRECT, "distribution of the source code, even though third parties are not");
Msg(DIRECT, "compelled to copy the source along with the object code.");
Msg(DIRECT, "");
Msg(DIRECT, " 4. You may not copy, modify, sublicense, or distribute the Program");
Msg(DIRECT, "except as expressly provided under this License. Any attempt");
Msg(DIRECT, "otherwise to copy, modify, sublicense or distribute the Program is");
Msg(DIRECT, "void, and will automatically terminate your rights under this License.");
Msg(DIRECT, "However, parties who have received copies, or rights, from you under");
Msg(DIRECT, "this License will not have their licenses terminated so long as such");
Msg(DIRECT, "parties remain in full compliance.");
Msg(DIRECT, "");
Msg(DIRECT, " 5. You are not required to accept this License, since you have not");
Msg(DIRECT, "signed it. However, nothing else grants you permission to modify or");
Msg(DIRECT, "distribute the Program or its derivative works. These actions are");
Msg(DIRECT, "prohibited by law if you do not accept this License. Therefore, by");
Msg(DIRECT, "modifying or distributing the Program (or any work based on the");
Msg(DIRECT, "Program), you indicate your acceptance of this License to do so, and");
Msg(DIRECT, "all its terms and conditions for copying, distributing or modifying");
Msg(DIRECT, "the Program or works based on it.");
Msg(DIRECT, "");
Msg(DIRECT, " 6. Each time you redistribute the Program (or any work based on the");
Msg(DIRECT, "Program), the recipient automatically receives a license from the");
Msg(DIRECT, "original licensor to copy, distribute or modify the Program subject to");
Msg(DIRECT, "these terms and conditions. You may not impose any further");
Msg(DIRECT, "restrictions on the recipients' exercise of the rights granted herein.");
Msg(DIRECT, "You are not responsible for enforcing compliance by third parties to");
Msg(DIRECT, "this License.");
Msg(DIRECT, "");
Msg(DIRECT, " 7. If, as a consequence of a court judgment or allegation of patent");
Msg(DIRECT, "infringement or for any other reason (not limited to patent issues),");
Msg(DIRECT, "conditions are imposed on you (whether by court order, agreement or");
Msg(DIRECT, "otherwise) that contradict the conditions of this License, they do not");
Msg(DIRECT, "excuse you from the conditions of this License. If you cannot");
Msg(DIRECT, "distribute so as to satisfy simultaneously your obligations under this");
Msg(DIRECT, "License and any other pertinent obligations, then as a consequence you");
Msg(DIRECT, "may not distribute the Program at all. For example, if a patent");
Msg(DIRECT, "license would not permit royalty-free redistribution of the Program by");
Msg(DIRECT, "all those who receive copies directly or indirectly through you, then");
Msg(DIRECT, "the only way you could satisfy both it and this License would be to");
Msg(DIRECT, "refrain entirely from distribution of the Program.");
Msg(DIRECT, "");
Msg(DIRECT, "If any portion of this section is held invalid or unenforceable under");
Msg(DIRECT, "any particular circumstance, the balance of the section is intended to");
Msg(DIRECT, "apply and the section as a whole is intended to apply in other");
Msg(DIRECT, "circumstances.");
Msg(DIRECT, "");
Msg(DIRECT, "It is not the purpose of this section to induce you to infringe any");
Msg(DIRECT, "patents or other property right claims or to contest validity of any");
Msg(DIRECT, "such claims; this section has the sole purpose of protecting the");
Msg(DIRECT, "integrity of the free software distribution system, which is");
Msg(DIRECT, "implemented by public license practices. Many people have made");
Msg(DIRECT, "generous contributions to the wide range of software distributed");
Msg(DIRECT, "through that system in reliance on consistent application of that");
Msg(DIRECT, "system; it is up to the author/donor to decide if he or she is willing");
Msg(DIRECT, "to distribute software through any other system and a licensee cannot");
Msg(DIRECT, "impose that choice.");
Msg(DIRECT, "");
Msg(DIRECT, "This section is intended to make thoroughly clear what is believed to");
Msg(DIRECT, "be a consequence of the rest of this License.");
Msg(DIRECT, "");
Msg(DIRECT, " 8. If the distribution and/or use of the Program is restricted in");
Msg(DIRECT, "certain countries either by patents or by copyrighted interfaces, the");
Msg(DIRECT, "original copyright holder who places the Program under this License");
Msg(DIRECT, "may add an explicit geographical distribution limitation excluding");
Msg(DIRECT, "those countries, so that distribution is permitted only in or among");
Msg(DIRECT, "countries not thus excluded. In such case, this License incorporates");
Msg(DIRECT, "the limitation as if written in the body of this License.");
Msg(DIRECT, "");
Msg(DIRECT, " 9. The Free Software Foundation may publish revised and/or new versions");
Msg(DIRECT, "of the General Public License from time to time. Such new versions will");
Msg(DIRECT, "be similar in spirit to the present version, but may differ in detail to");
Msg(DIRECT, "address new problems or concerns.");
Msg(DIRECT, "");
Msg(DIRECT, "Each version is given a distinguishing version number. If the Program");
Msg(DIRECT, "specifies a version number of this License which applies to it and \"any");
Msg(DIRECT, "later version\", you have the option of following the terms and conditions");
Msg(DIRECT, "either of that version or of any later version published by the Free");
Msg(DIRECT, "Software Foundation. If the Program does not specify a version number of");
Msg(DIRECT, "this License, you may choose any version ever published by the Free Software");
Msg(DIRECT, "Foundation.");
Msg(DIRECT, "");
Msg(DIRECT, " 10. If you wish to incorporate parts of the Program into other free");
Msg(DIRECT, "programs whose distribution conditions are different, write to the author");
Msg(DIRECT, "to ask for permission. For software which is copyrighted by the Free");
Msg(DIRECT, "Software Foundation, write to the Free Software Foundation; we sometimes");
Msg(DIRECT, "make exceptions for this. Our decision will be guided by the two goals");
Msg(DIRECT, "of preserving the free status of all derivatives of our free software and");
Msg(DIRECT, "of promoting the sharing and reuse of software generally.");
Msg(DIRECT, "");
Msg(DIRECT, " NO WARRANTY");
Msg(DIRECT, "");
Msg(DIRECT, " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY");
Msg(DIRECT, "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN");
Msg(DIRECT, "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES");
Msg(DIRECT, "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED");
Msg(DIRECT, "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF");
Msg(DIRECT, "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS");
Msg(DIRECT, "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE");
Msg(DIRECT, "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,");
Msg(DIRECT, "REPAIR OR CORRECTION.");
Msg(DIRECT, "");
Msg(DIRECT, " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING");
Msg(DIRECT, "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR");
Msg(DIRECT, "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,");
Msg(DIRECT, "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING");
Msg(DIRECT, "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED");
Msg(DIRECT, "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY");
Msg(DIRECT, "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER");
Msg(DIRECT, "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE");
Msg(DIRECT, "POSSIBILITY OF SUCH DAMAGES.");
Msg(DIRECT, "");
Msg(DIRECT, " END OF TERMS AND CONDITIONS");
Msg(DIRECT, "");
Msg(DIRECT, " How to Apply These Terms to Your New Programs");
Msg(DIRECT, "");
Msg(DIRECT, " If you develop a new program, and you want it to be of the greatest");
Msg(DIRECT, "possible use to the public, the best way to achieve this is to make it");
Msg(DIRECT, "free software which everyone can redistribute and change under these terms.");
Msg(DIRECT, "");
Msg(DIRECT, " To do so, attach the following notices to the program. It is safest");
Msg(DIRECT, "to attach them to the start of each source file to most effectively");
Msg(DIRECT, "convey the exclusion of warranty; and each file should have at least");
Msg(DIRECT, "the \"copyright\" line and a pointer to where the full notice is found.");
Msg(DIRECT, "");
Msg(DIRECT, " <one line to give the program's name and a brief idea of what it does.>");
Msg(DIRECT, " Copyright (C) <year> <name of author>");
Msg(DIRECT, "");
Msg(DIRECT, " This program is free software; you can redistribute it and/or modify");
Msg(DIRECT, " it under the terms of the GNU General Public License as published by");
Msg(DIRECT, " the Free Software Foundation; either version 2 of the License, or");
Msg(DIRECT, " (at your option) any later version.");
Msg(DIRECT, "");
Msg(DIRECT, " This program is distributed in the hope that it will be useful,");
Msg(DIRECT, " but WITHOUT ANY WARRANTY; without even the implied warranty of");
Msg(DIRECT, " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the");
Msg(DIRECT, " GNU General Public License for more details.");
Msg(DIRECT, "");
Msg(DIRECT, " You should have received a copy of the GNU General Public License");
Msg(DIRECT, " along with this program; if not, write to the Free Software");
Msg(DIRECT, " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA");
Msg(DIRECT, "");
Msg(DIRECT, "");
Msg(DIRECT, "Also add information on how to contact you by electronic and paper mail.");
Msg(DIRECT, "");
Msg(DIRECT, "If the program is interactive, make it output a short notice like this");
Msg(DIRECT, "when it starts in an interactive mode:");
Msg(DIRECT, "");
Msg(DIRECT, " Gnomovision version 69, Copyright (C) year name of author");
Msg(DIRECT, " Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.");
Msg(DIRECT, " This is free software, and you are welcome to redistribute it");
Msg(DIRECT, " under certain conditions; type `show c' for details.");
Msg(DIRECT, "");
Msg(DIRECT, "The hypothetical commands `show w' and `show c' should show the appropriate");
Msg(DIRECT, "parts of the General Public License. Of course, the commands you use may");
Msg(DIRECT, "be called something other than `show w' and `show c'; they could even be");
Msg(DIRECT, "mouse-clicks or menu items--whatever suits your program.");
Msg(DIRECT, "");
Msg(DIRECT, "You should also get your employer (if you work as a programmer) or your");
Msg(DIRECT, "school, if any, to sign a \"copyright disclaimer\" for the program, if");
Msg(DIRECT, "necessary. Here is a sample; alter the names:");
Msg(DIRECT, "");
Msg(DIRECT, " Yoyodyne, Inc., hereby disclaims all copyright interest in the program");
Msg(DIRECT, " `Gnomovision' (which makes passes at compilers) written by James Hacker.");
Msg(DIRECT, "");
Msg(DIRECT, " <signature of Ty Coon>, 1 April 1989");
Msg(DIRECT, " Ty Coon, President of Vice");
Msg(DIRECT, "");
Msg(DIRECT, "This General Public License does not permit incorporating your program into");
Msg(DIRECT, "proprietary programs. If your program is a subroutine library, you may");
Msg(DIRECT, "consider it more useful to permit linking proprietary applications with the");
Msg(DIRECT, "library. If this is what you want to do, use the GNU Library General");
Msg(DIRECT, "Public License instead of this License.");
}
#ifndef _GMSH_H_
#define _GMSH_H_
// Copyright (C) 1997-2003 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".
#undef bool
#define bool int
#undef true
#define true 1
#undef false
#define false 0
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "Message.h"
#include "Malloc.h"
#include "List.h"
#include "Tree.h"
#include "Tools.h"
#endif