赞
踩
目录
TELEMAC-MASCARET是法国电力集团(EDF)的法国国立水利与环境实验室开发的一款研究水动力学和水文学领域的高性能数值仿真开源软件。基于有限元法,使用不规则三角网格,让复杂的海岸线和河口的描绘更为精确。该软件可以构建1D、2D和3D水动力学模型以解决波浪传播、波浪振动特性、水质污染、泥沙输运和海床形态变化等问题,拥有丰富的用户技术支持和广泛的工业应用及验证。
1、Fortran编译器(gfortran≥4.6.3)
2、python (版本>3.7)
3、Numpy (python库,版本>1.15)
1、MPI(可以是MPICH、OpenMPI)
2、Metis(版本 5.1.0)
3、SCOTCH(不可用来代替metis)
4、SciPy、Matplotlib(python库)
5、HDF5或MED
6、MUMPS(TELEMAC软件中只有ARTEMIS模块用到该求解器,可选择性安装)
7、AED2(将激活 WAQTEL 模块中的更多进程)
8、GOTM(安装该模块可以在 TELEMAC-3D 软件中使用一般海洋湍流模型)
建议安装1和2。
方式1:直接通过下面的链接进行下载,版本为v8p4r0:
$ git clone https://gitlab.pam-retd.fr/otm/telemac-mascaret.git my_opentelemac
方式3:通过访问软件在Gitlab的网站下载。
unzip telemac-mascaret-main.zip
这里主要介绍软件的并行版本安装。
① 进入../telemac-mascaret-main/configs文件夹。
cd telemac-mascaret-main/configs
② 复制并重命名pysource.template.sh文件为pysource.sh。
cp pysource.template.sh pysource.sh
③ 打开pysource.sh文件并修改。
修改后的文件如下:
- # This file is a Linux environment file template
- # Sourcing it will position all the environment variables required
- # to compile and run TELEMAC
- # You only need to replace <your-systel-file> and <your-config>
- # to reflect your own configuration
- #
- # Path to TELEMAC root directory
- export HOMETEL=/mnt/e/telemac-mascaret-main
- # Configuration file
- export SYSTELCFG=$HOMETEL/configs/systel.cfg
- # Name of the configuration to use
- export USETELCFG=gfortranHPC
- # Path to this file
- export SOURCEFILE=$HOMETEL/configs/pysource.sh
- # Add TELEMAC Python scripts to PATH
- export PATH=$HOMETEL/scripts/python3:.:$PATH
- # Add TELEMAC libraries to LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$HOMETEL/builds/$USETELCFG/lib:$LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$HOMETEL/builds/$USETELCFG/wrap_api/lib:$LD_LIBRARY_PATH
- # Add TELEMAC Python scripts and extension modules to PYTHONPATH
- export PYTHONPATH=$HOMETEL/scripts/python3:$PYTHONPATH
- export PYTHONPATH=$HOMETEL/builds/$USETELCFG/wrap_api/lib:$PYTHONPATH
- # Force Python to flush its output
- export PYTHONUNBUFFERED='true'
- # Add Metis
- #export METISHOME=/mnt/e/Metis5.0

其中,最后一行的METISHOME根据自己的情况决定是否添加。METISHOME变量是metis的安装路径。
④ 其他可选依赖项环境变量配置。
如安装HDF5/MED,需要在pysource.sh文件中继续添加(其中HDF5HOME和MEDHOME为HDF5和MED的自定义安装路径):
- ### HDF5 -------------------------------------------------------------
- export HDF5HOME=../hdf5-1.10.7
- export LD_LIBRARY_PATH=$HDF5HOME/lib:$LD_LIBRARY_PATH
- ### MED -------------------------------------------------------------
- export MEDHOME=../med-4.1.0
- export LD_LIBRARY_PATH=$MEDHOME/lib:$LD_LIBRARY_PATH
- export PATH=$MEDHOME/bin:$PATH
如安装SCOTCH, 需要在pysource.sh文件中继续添加(其中SCOTCHHOME为SCOTCH的自定义安装路径):
- ### SCOTCH -------------------------------------------------------------
- export SCOTCHHOME=../scotch-6.0.0
- export LD_LIBRARY_PATH=$SCOTCHHOME/lib:$LD_LIBRARY_PATH
如安装AED2, 需要在pysource.sh文件中继续添加(其中AED2HOME为AED2的自定义安装路径):
- ### AED2 --------------------------------------------------------------
- export AED2HOME=../aed2-1.2.0
- export LD_LIBRARY_PATH=$AED2HOME/lib:$LD_LIBRARY_PATH
① 进入../telemac-mascaret-main/configs文件夹。
cd telemac-mascaret-main/configs
② 新建systel.cfg文件。
vi systel.cfg
③ systel.cfg添加相关内容,如下:
- #_____ _______________________________
- # ____/ TELEMAC Project Definitions /______________________________/
- #
- [Configurations]
- configs: gfortran gfortranHPC
- # _____ ____________________________________
- # ____/ General /___________________________________/
- # Global declarations that are set by default for all the configurations
- [general]
- language: 2
- modules: system
- version: v8p4
- #
- options: static api
- #
- f2py_name: f2py3
- pyd_fcompiler: gnu95
- #
- sfx_zip: .zip
- sfx_lib: .a
- sfx_obj: .o
- sfx_mod: .mod
- sfx_exe:
- #
- #
- val_root: <root>/examples
- #
- val_rank: all
- #
- mods_all: -I <config>
- #
- incs_all:
- #
- libs_all:
- #
- cmd_obj_c: gcc -fPIC -c <srcName> -o <objName>
- #
- [gfortran]
- brief: GFortran compiler
- #
- cmd_obj: gfortran -c -cpp -fPIC -O2 -fconvert=big-endian -frecord-marker=4 -DHAVE_VTK <mods> <incs> <f95name>
- cmd_lib: ar cru <libname> <objs>
- cmd_exe: gfortran -fPIC -fconvert=big-endian -frecord-marker=4 -lpthread -lm -o <exename> <objs> <libs>
- #
- # Gfortran HPC
- #
- [gfortranHPC]
- brief: GFortran compiler using Open MPI
- #
- mpi_cmdexec: mpirun -machinefile MPI_HOSTFILE -np <ncsize> <exename>
- #
- cmd_obj: mpif90 -c -cpp -fPIC -O2 -fconvert=big-endian -frecord-marker=4 -DHAVE_MPI -DHAVE_VTK <mods> <incs> <f95name>
- cmd_lib: ar cru <libname> <objs>
- cmd_exe: mpif90 -fPIC -fconvert=big-endian -frecord-marker=4 -lpthread -lm -o <exename> <objs> <libs>
- #
- libs_all: -L$METISHOME/lib -lmetis

④ 其他可选依赖项配置:
如安装HDF5/MED,需添加:
- incs_all: -I$MEDHOME/include
- cmd_obj: -DHAVE_MED
- libs_all: -L$HDF5HOME/lib -lhdf5 -L$MEDHOME/lib -lmed -lstdc++ -lz
如安装SCOTCH,需添加:
- incs_all: -I$SCOTCHHOME/include
- cmd_obj: -DHAVE_SCOTCH
- libs_all: -L$SCOTCHHOME/lib -lsctoch -lsctocherr
如安装AED2,需添加:
- incs_all add -I$AED2HOME/include -I$AED2HOME/mod
- cmd_obj add -DHAVE_AED2
- libs_all add -L$AED2HOME/lib -laed2
① 设置环境变量。利用source对3.1节中修改的pysource.sh进行设置。
source pysource.sh
② 配置文件生成。
config.py
配置完成:
③ 编译安装
compile_telemac.py
安装完成:
安装文件夹:
其它安装细节及安装选项,可参考官网指南:
installation_on_linux · open TELEMAC-MASCAREThttp://wiki.opentelemac.org/doku.php?id=installation_on_linux#optional_proxy
利用软件自带算例进行测试(算例路径:../examples/telemac2d/gouttedo):
telemac2d.py t2d_gouttedo.cas
运行结果如下:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。